Class: OpenEHR::AM::Archetype::ConstraintModel::CAttribute
- Inherits:
-
ArchetypeConstraint
- Object
- ArchetypeConstraint
- OpenEHR::AM::Archetype::ConstraintModel::CAttribute
- Defined in:
- lib/openehr/am/archetype/constraint_model.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#existence ⇒ Object
Returns the value of attribute existence.
-
#rm_attribute_name ⇒ Object
Returns the value of attribute rm_attribute_name.
Attributes inherited from ArchetypeConstraint
Instance Method Summary collapse
- #has_children? ⇒ Boolean
-
#initialize(args = { }) ⇒ CAttribute
constructor
A new instance of CAttribute.
-
#node_conforms_to?(other) ⇒ Boolean
Whether this (potentially specialised) attribute node is a legal redefinition of
other: same rm_attribute_name and an existence no wider than the parent's. - #path ⇒ Object
Methods inherited from ArchetypeConstraint
Constructor Details
#initialize(args = { }) ⇒ CAttribute
Returns a new instance of CAttribute.
179 180 181 182 183 184 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 179 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
#children ⇒ Object
Returns the value of attribute children.
177 178 179 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 177 def children @children end |
#existence ⇒ Object
Returns the value of attribute existence.
177 178 179 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 177 def existence @existence end |
#rm_attribute_name ⇒ Object
Returns the value of attribute rm_attribute_name.
177 178 179 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 177 def rm_attribute_name @rm_attribute_name end |
Instance Method Details
#has_children? ⇒ Boolean
207 208 209 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 207 def has_children? !@children.nil? and !@children.empty? end |
#node_conforms_to?(other) ⇒ Boolean
Whether this (potentially specialised) attribute node is
a legal redefinition of other: same rm_attribute_name
and an existence no wider than the parent's.
218 219 220 221 222 223 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 218 def node_conforms_to?(other) return false if other.nil? rm_attribute_name == other.rm_attribute_name && interval_conforms_to?(existence, other.existence) end |
#path ⇒ Object
211 212 213 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 211 def path @path || calculate_path end |