Changeset 207 for ruby/branches/0.5/lib/open_ehr/rm
- Timestamp:
- Aug 16, 2009, 7:14:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/branches/0.5/lib/open_ehr/rm/data_structures/item_structure.rb
r203 r207 57 57 58 58 def ith_item(i) 59 return @items[i] 59 raise ArgumentError, 'index invalid' if i <= 0 60 return @items[i - 1] 60 61 end 61 62 … … 82 83 end 83 84 end 85 86 def column_count 87 if @rows.nil? 88 return 0 89 else 90 return @rows[0].items.count 91 end 92 end 93 94 def row_names 95 if @rows.nil? 96 return [] 97 else 98 return @rows.collect{|r| r.name} 99 end 100 end 101 102 def column_names 103 if @rows.nil? 104 return [] 105 else 106 return @rows[0].items.collect{|i| i.name} 107 end 108 end 109 110 def ith_row(i) 111 raise ArgumentError, 'invalid index' if i<=0 or i>@rows.size 112 if @rows.nil? 113 return [] 114 else 115 return @rows[i - 1] 116 end 117 end 84 118 end 85 119 end # of ItemStructure
Note:
See TracChangeset
for help on using the changeset viewer.