Ignore:
Timestamp:
Aug 14, 2009, 8:11:44 PM (15 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #54

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/branches/0.5/lib/open_ehr/rm/data_structures/item_structure.rb

    r194 r195  
    3232          attr_accessor :items
    3333
     34          def initialize(args = {})
     35            super(args)
     36            self.items = args[:items]
     37          end
     38
    3439          def item_count
    3540            unless @items.nil?
     
    3944            end
    4045          end
     46
     47          def names
     48            return @items.collect{|item| item.name}
     49          end
     50
     51          def named_item(a_name)
     52            @items.each do |item|
     53              return item if item.name.value == a_name
     54            end
     55            retrun nil
     56          end
     57
     58          def ith_item(i)
     59            return @items[i]
     60          end
     61
     62          def as_hierarchy
     63            return Cluster.new(:name => @name,
     64                               :archetype_node_id => @archetype_node_id,
     65                               :items => @items)
     66          end
    4167        end
    4268      end # of ItemStructure
Note: See TracChangeset for help on using the changeset viewer.