Class: OpenEHR::RM::Support::Identification::TerminologyID
- Defined in:
- lib/open_ehr/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.
155 156 157 158 159 160 161 162 |
# File 'lib/open_ehr/rm/support/identification.rb', line 155 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.
153 154 155 |
# File 'lib/open_ehr/rm/support/identification.rb', line 153 def name @name end |
#version_id ⇒ Object
Returns the value of attribute version_id.
153 154 155 |
# File 'lib/open_ehr/rm/support/identification.rb', line 153 def version_id @version_id end |
Instance Method Details
#value ⇒ Object
164 165 166 167 168 169 170 |
# File 'lib/open_ehr/rm/support/identification.rb', line 164 def value if @version_id.empty? @name else @name + '(' + @version_id + ')' end end |
#value=(value) ⇒ Object
173 174 175 176 177 178 179 180 181 182 |
# File 'lib/open_ehr/rm/support/identification.rb', line 173 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 |