Changeset 297 for ruby/trunk/lib/open_ehr/rm/common/archetyped.rb
- Timestamp:
- Sep 25, 2009, 12:15:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/lib/open_ehr/rm/common/archetyped.rb
r167 r297 2 2 # http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109318114715_211173_0Report.html 3 3 # Ticket refs #65 4 module OpenE hr4 module OpenEHR 5 5 module RM 6 6 module Common … … 17 17 attr_accessor :parent 18 18 19 def initialize( parent = nil)20 @parent = parent19 def initialize(args = { }) 20 self.parent = args[:parent] 21 21 end 22 22 23 23 def item_at_path(path) 24 raise NotImplement Error, "item_at_path must be implemented"24 raise NotImplementedError, "item_at_path must be implemented" 25 25 end 26 26 27 27 def items_at_path(path) 28 raise NotImplement Error, "items_at_path must be implemented"28 raise NotImplementedError, "items_at_path must be implemented" 29 29 end 30 30 31 31 def path_exists?(path) 32 raise NotImplement Error, "path_exists? must be implemented"32 raise NotImplementedError, "path_exists? must be implemented" 33 33 end 34 34 35 35 def path_of_item(item) 36 raise NotImplement Error, "path_of_item must be implemented"36 raise NotImplementedError, "path_of_item must be implemented" 37 37 end 38 38 39 def path_unique (path)40 raise NotImplement Error, "path_uniquemust be implemented"39 def path_unique?(path) 40 raise NotImplementedError, "path_unique? must be implemented" 41 41 end 42 42 end … … 48 48 49 49 def initialize(args = { }) 50 super(args [:parent])50 super(args) 51 51 self.archetype_node_id = args[:archetype_node_id] 52 52 self.name = args[:name] … … 58 58 59 59 def archetype_node_id=(archetype_node_id) 60 raise ArgumentError, 'archetype_node_id should not be nil' if archetype_node_id.nil? 60 if archetype_node_id.nil? or archetype_node_id.empty? 61 raise ArgumentError, 'archetype_node_id should not be nil' 62 end 61 63 @archetype_node_id = archetype_node_id 62 64 end
Note:
See TracChangeset
for help on using the changeset viewer.