Class: OpenEHR::AM::Archetype::ConstraintModel::CObject

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

Direct Known Subclasses

CDefinedObject, CReferenceObject

Instance Attribute Summary collapse

Attributes inherited from ArchetypeConstraint

#parent

Instance Method Summary collapse

Methods inherited from ArchetypeConstraint

#congruent?, #has_path?, #node_conforms_to?

Constructor Details

#initialize(args = { }) ⇒ CObject

Returns a new instance of CObject.



85
86
87
88
89
90
# File 'lib/openehr/am/archetype/constraint_model.rb', line 85

def initialize(args = { })
  super
  self.rm_type_name = args[:rm_type_name]
  self.node_id = args[:node_id]
  self.occurrences = args[:occurrences]
end

Instance Attribute Details

#node_idObject

Returns the value of attribute node_id.



83
84
85
# File 'lib/openehr/am/archetype/constraint_model.rb', line 83

def node_id
  @node_id
end

#occurrencesObject

Returns the value of attribute occurrences.



83
84
85
# File 'lib/openehr/am/archetype/constraint_model.rb', line 83

def occurrences
  @occurrences
end

#rm_type_nameObject

Returns the value of attribute rm_type_name.



83
84
85
# File 'lib/openehr/am/archetype/constraint_model.rb', line 83

def rm_type_name
  @rm_type_name
end

Instance Method Details

#pathObject



113
114
115
# File 'lib/openehr/am/archetype/constraint_model.rb', line 113

def path
  @path || calculate_path
end

#to_rmObject



117
118
119
# File 'lib/openehr/am/archetype/constraint_model.rb', line 117

def to_rm
  @rm ||= OpenEHR::RM::Factory.create(rm_type_name, params)
end