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.



136
137
138
139
140
141
# File 'lib/openehr/am/archetype/constraint_model.rb', line 136

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.



134
135
136
# File 'lib/openehr/am/archetype/constraint_model.rb', line 134

def children
  @children
end

#existenceObject

Returns the value of attribute existence.



134
135
136
# File 'lib/openehr/am/archetype/constraint_model.rb', line 134

def existence
  @existence
end

#rm_attribute_nameObject

Returns the value of attribute rm_attribute_name.



134
135
136
# File 'lib/openehr/am/archetype/constraint_model.rb', line 134

def rm_attribute_name
  @rm_attribute_name
end

Instance Method Details

#has_children?Boolean

Returns:

  • (Boolean)


164
165
166
# File 'lib/openehr/am/archetype/constraint_model.rb', line 164

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

#pathObject



168
169
170
# File 'lib/openehr/am/archetype/constraint_model.rb', line 168

def path
  @path || calculate_path
end