Class: OpenEHR::AM::OpenEHRProfile::DataTypes::Basic::CDvState
- Inherits:
-
Archetype::ConstraintModel::CDomainType
- Object
- Archetype::ConstraintModel::ArchetypeConstraint
- Archetype::ConstraintModel::CObject
- Archetype::ConstraintModel::CDefinedObject
- Archetype::ConstraintModel::CDomainType
- OpenEHR::AM::OpenEHRProfile::DataTypes::Basic::CDvState
- Defined in:
- lib/openehr/am/openehr_profile/data_types/basic.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Archetype::ConstraintModel::CDefinedObject
Attributes inherited from Archetype::ConstraintModel::CObject
#node_id, #occurrences, #rm_type_name
Attributes inherited from Archetype::ConstraintModel::ArchetypeConstraint
Instance Method Summary collapse
-
#initialize(args = { }) ⇒ CDvState
constructor
A new instance of CDvState.
- #valid_value?(rm_value) ⇒ Boolean
Methods inherited from Archetype::ConstraintModel::CDomainType
Methods inherited from Archetype::ConstraintModel::CDefinedObject
#any_allowed?, #default_value, #has_assumed_value?
Methods inherited from Archetype::ConstraintModel::CObject
#node_conforms_to?, #path, #to_rm
Methods inherited from Archetype::ConstraintModel::ArchetypeConstraint
#congruent?, #has_path?, #node_conforms_to?
Constructor Details
#initialize(args = { }) ⇒ CDvState
Returns a new instance of CDvState.
11 12 13 14 15 |
# File 'lib/openehr/am/openehr_profile/data_types/basic.rb', line 11 def initialize(args = { }) args[:rm_type_name] = 'DvState' super self.value = args[:value] end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
9 10 11 |
# File 'lib/openehr/am/openehr_profile/data_types/basic.rb', line 9 def value @value end |
Instance Method Details
#valid_value?(rm_value) ⇒ Boolean
22 23 24 25 26 27 28 29 30 |
# File 'lib/openehr/am/openehr_profile/data_types/basic.rb', line 22 def valid_value?(rm_value) return false if rm_value.nil? state = matching_state(rm_value) return false if state.nil? return true unless rm_value.respond_to?(:is_terminal?) rm_value.is_terminal? == state.is_a?(TerminalState) end |