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

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

Direct Known Subclasses

ARCHETYPE_TERM

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = { }) ⇒ ArchetypeTerm

Returns a new instance of ArchetypeTerm.



94
95
96
97
# File 'lib/open_ehr/am/archetype/ontology.rb', line 94

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



114
115
116
# File 'lib/open_ehr/am/archetype/ontology.rb', line 114

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

Instance Attribute Details

#codeObject

Returns the value of attribute code.



92
93
94
# File 'lib/open_ehr/am/archetype/ontology.rb', line 92

def code
  @code
end

#itemsObject

Returns the value of attribute items.



91
92
93
# File 'lib/open_ehr/am/archetype/ontology.rb', line 91

def items
  @items
end

Instance Method Details

#keysObject



106
107
108
109
110
111
112
# File 'lib/open_ehr/am/archetype/ontology.rb', line 106

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