Class: OpenEHR::AM::Archetype::ConstraintModel::CObject
- Inherits:
-
ArchetypeConstraint
- Object
- ArchetypeConstraint
- OpenEHR::AM::Archetype::ConstraintModel::CObject
- Defined in:
- lib/openehr/am/archetype/constraint_model.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#node_id ⇒ Object
Returns the value of attribute node_id.
-
#occurrences ⇒ Object
Returns the value of attribute occurrences.
-
#rm_type_name ⇒ Object
Returns the value of attribute rm_type_name.
Attributes inherited from ArchetypeConstraint
Instance Method Summary collapse
-
#initialize(args = { }) ⇒ CObject
constructor
A new instance of CObject.
-
#node_conforms_to?(other) ⇒ Boolean
Whether this (potentially specialised) node is a legal redefinition of
other, the corresponding node in the flat parent archetype: same node_id lineage (at0001.1 specialises at0001), same rm_type_name (subtype checking is deferred until the RM type-name helper lands), and occurrences no wider than the parent's. - #path ⇒ Object
- #to_rm ⇒ Object
Methods inherited from ArchetypeConstraint
Constructor Details
#initialize(args = { }) ⇒ CObject
Returns a new instance of CObject.
98 99 100 101 102 103 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 98 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_id ⇒ Object
Returns the value of attribute node_id.
96 97 98 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 96 def node_id @node_id end |
#occurrences ⇒ Object
Returns the value of attribute occurrences.
96 97 98 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 96 def occurrences @occurrences end |
#rm_type_name ⇒ Object
Returns the value of attribute rm_type_name.
96 97 98 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 96 def rm_type_name @rm_type_name end |
Instance Method Details
#node_conforms_to?(other) ⇒ Boolean
Whether this (potentially specialised) node is a legal
redefinition of other, the corresponding node in the
flat parent archetype: same node_id lineage (at0001.1
specialises at0001), same rm_type_name (subtype checking
is deferred until the RM type-name helper lands), and
occurrences no wider than the parent's.
140 141 142 143 144 145 146 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 140 def node_conforms_to?(other) return false if other.nil? node_id_conforms_to?(other.node_id) && rm_type_name == other.rm_type_name && interval_conforms_to?(occurrences, other.occurrences) end |
#path ⇒ Object
126 127 128 |
# File 'lib/openehr/am/archetype/constraint_model.rb', line 126 def path @path || calculate_path end |