Changeset 373 for ruby/trunk/lib/open_ehr/am/archetype/constraint_model.rb
- Timestamp:
- Dec 15, 2009, 9:42:09 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/lib/open_ehr/am/archetype/constraint_model.rb
r372 r373 5 5 module ConstraintModel 6 6 class ArchetypeConstraint 7 attr_reader :path 8 attr_accessor :parent 7 9 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 8 43 end 9 44
Note:
See TracChangeset
for help on using the changeset viewer.