Class: OpenEHR::AM::Archetype::ConstraintModel::CAttribute

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

Direct Known Subclasses

CMultipleAttribute, CSingleAttribute

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 = { }) ⇒ CAttribute

Returns a new instance of CAttribute.



144
145
146
147
148
149
# File 'lib/openehr/am/archetype/constraint_model.rb', line 144

def initialize(args = { })
  super(args)
  self.rm_attribute_name = args[:rm_attribute_name]
  self.existence = args[:existence]
  self.children = args[:children]
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



142
143
144
# File 'lib/openehr/am/archetype/constraint_model.rb', line 142

def children
  @children
end

#existenceObject

Returns the value of attribute existence.



142
143
144
# File 'lib/openehr/am/archetype/constraint_model.rb', line 142

def existence
  @existence
end

#rm_attribute_nameObject

Returns the value of attribute rm_attribute_name.



142
143
144
# File 'lib/openehr/am/archetype/constraint_model.rb', line 142

def rm_attribute_name
  @rm_attribute_name
end

Instance Method Details

#has_children?Boolean

Returns:

  • (Boolean)


172
173
174
# File 'lib/openehr/am/archetype/constraint_model.rb', line 172

def has_children?
  !@children.nil? and !@children.empty?
end

#pathObject



176
177
178
# File 'lib/openehr/am/archetype/constraint_model.rb', line 176

def path
  @path || calculate_path
end