Class: OpenEHR::AM::Archetype::ConstraintModel::CPrimitiveObject

Inherits:
CDefinedObject show all
Defined in:
lib/openehr/am/archetype/constraint_model.rb

Instance Attribute Summary collapse

Attributes inherited from CDefinedObject

#assumed_value

Attributes inherited from CObject

#node_id, #occurrences, #rm_type_name

Attributes inherited from ArchetypeConstraint

#parent, #path

Instance Method Summary collapse

Methods inherited from CDefinedObject

#default_value, #has_assumed_value?, #valid_value?

Methods inherited from CObject

#path

Methods inherited from ArchetypeConstraint

#congruent?, #has_path?, #node_conforms_to?

Constructor Details

#initialize(args = { }) ⇒ CPrimitiveObject

Returns a new instance of CPrimitiveObject.



210
211
212
213
# File 'lib/openehr/am/archetype/constraint_model.rb', line 210

def initialize(args = { })
  super
  self.item = args[:item]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



226
227
228
229
230
231
232
# File 'lib/openehr/am/archetype/constraint_model.rb', line 226

def method_missing(meth, *args)
  if !self.item.nil? && self.item.respond_to?(meth)
    self.item.send(meth, *args)
  else
    super
  end
end

Instance Attribute Details

#itemObject

Returns the value of attribute item.



208
209
210
# File 'lib/openehr/am/archetype/constraint_model.rb', line 208

def item
  @item
end

Instance Method Details

#any_allowed?Boolean

Returns:

  • (Boolean)


215
216
217
# File 'lib/openehr/am/archetype/constraint_model.rb', line 215

def any_allowed?
  return item.nil?
end