Class: OpenEHR::AM::Archetype::Ontology::ArchetypeTerm

Inherits:
Object
  • Object
show all
Defined in:
lib/openehr/am/archetype/ontology.rb

Direct Known Subclasses

ARCHETYPE_TERM, Terminology::ArchetypeTerm

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = { }) ⇒ ArchetypeTerm

Returns a new instance of ArchetypeTerm.



99
100
101
102
# File 'lib/openehr/am/archetype/ontology.rb', line 99

def initialize(args = { })
  self.code = args[:code]
  self.items =args[:items]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(key) ⇒ Object



119
120
121
# File 'lib/openehr/am/archetype/ontology.rb', line 119

def method_missing(key)
  return @items[key.to_sym]
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



97
98
99
# File 'lib/openehr/am/archetype/ontology.rb', line 97

def code
  @code
end

#itemsObject

Returns the value of attribute items.



96
97
98
# File 'lib/openehr/am/archetype/ontology.rb', line 96

def items
  @items
end

Instance Method Details

#keysObject



111
112
113
114
115
116
117
# File 'lib/openehr/am/archetype/ontology.rb', line 111

def keys
  if items.nil?
    return Set.new
  else
    return Set.new(@items.keys)
  end
end