Ignore:
Timestamp:
Dec 15, 2009, 9:42:09 PM (14 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #72

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/open_ehr/am/archetype/constraint_model.rb

    r372 r373  
    55      module ConstraintModel
    66        class ArchetypeConstraint
     7          attr_reader :path
     8          attr_accessor :parent
    79
     10          def initialize(args = { })
     11            self.path = args[:path]
     12            self.parent = args[:parent]
     13          end
     14
     15          def path=(path)
     16            if path.nil?
     17              raise ArgumentError, 'path is mandatory'
     18            end
     19            @path = path
     20          end
     21
     22          def has_path?(path)
     23            return @path.include?(path)
     24          end
     25
     26          def congruent?
     27            if @path.index(@parent.path) == 0
     28              return true
     29            else
     30              return false
     31            end
     32          end
     33
     34          alias is_congruent? congruent?
     35
     36          def node_conforms_to?(other)
     37            if @path.index(other.path) == 0
     38              return true
     39            else
     40              return false
     41            end
     42          end
    843        end
    944
Note: See TracChangeset for help on using the changeset viewer.