Ignore:
Timestamp:
Nov 20, 2009, 3:11:04 PM (14 years ago)
Author:
KOBAYASHI, Shinji
Message:

merge from branches/0.5

Location:
ruby/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk

  • ruby/trunk/lib/open_ehr/rm/data_structures/item_structure.rb

    r299 r369  
    5454              return item if item.name.value == a_name
    5555            end
    56             retrun nil
     56            return nil
    5757          end
    5858
     
    111111          def ith_row(i)
    112112            raise ArgumentError, 'invalid index' if i<=0 or i>@rows.size
    113             if @rows.nil?
    114               return []
    115             else
    116               return @rows[i - 1]
    117             end
     113            return @rows[i - 1]
    118114          end
    119115
     
    139135              return row if row.items[0].name.value == key
    140136            end
    141             return []
    142137          end
    143138
     
    191186            self.items = args[:items]
    192187          end
     188
     189          def has_element_path?(path)
     190            paths = [ ]
     191            @items.each do |item|
     192              paths << item.archetype_node_id
     193            end
     194            return paths.include? path
     195          end
     196
     197          def element_at_path(path)
     198            @items.each do |item|
     199              return item if item.archetype_node_id == path
     200            end
     201            return nil
     202          end
     203
     204          def as_hierarchy
     205            return Cluster.new(:name => @name,
     206                               :archetype_node_id => @archetype_node_id,
     207                               :items => @items)
     208          end
    193209        end
    194210      end # of ItemStructure
Note: See TracChangeset for help on using the changeset viewer.