Class: OpenEHR::RM::Support::Identification::TerminologyID
- Defined in:
- lib/openehr/rm/support/identification.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#version_id ⇒ Object
Returns the value of attribute version_id.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ TerminologyID
constructor
A new instance of TerminologyID.
- #value ⇒ Object
- #value=(value) ⇒ Object
Methods inherited from ObjectID
Constructor Details
#initialize(args = {}) ⇒ TerminologyID
Returns a new instance of TerminologyID.
154 155 156 157 158 159 160 161 |
# File 'lib/openehr/rm/support/identification.rb', line 154 def initialize(args = {}) if args[:value].nil? self.name = args[:name] self.version_id = args[:version_id] else super(args) end end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
152 153 154 |
# File 'lib/openehr/rm/support/identification.rb', line 152 def name @name end |
#version_id ⇒ Object
Returns the value of attribute version_id.
152 153 154 |
# File 'lib/openehr/rm/support/identification.rb', line 152 def version_id @version_id end |
Instance Method Details
#value ⇒ Object
163 164 165 166 167 168 169 |
# File 'lib/openehr/rm/support/identification.rb', line 163 def value if @version_id.empty? @name else @name + '(' + @version_id + ')' end end |
#value=(value) ⇒ Object
172 173 174 175 176 177 178 179 180 181 |
# File 'lib/openehr/rm/support/identification.rb', line 172 def value=(value) raise ArgumentError, "value not valid" if value.nil? or value.empty? if /(.*)\((.*)\)/ =~ value self.name = $1 self.version_id = $2 else self.name = value self.version_id = '' end end |