Class: OpenEHR::RM::Support::Identification::UIDBasedID

Inherits:
ObjectID
  • Object
show all
Defined in:
lib/openehr/rm/support/identification.rb

Direct Known Subclasses

HierObjectID, ObjectVersionID

Instance Attribute Summary collapse

Attributes inherited from ObjectID

#value

Instance Method Summary collapse

Methods inherited from ObjectID

#==

Constructor Details

#initialize(args = {}) ⇒ UIDBasedID

Returns a new instance of UIDBasedID.



222
223
224
# File 'lib/openehr/rm/support/identification.rb', line 222

def initialize(args = {})
  super(args)
end

Instance Attribute Details

#extensionObject (readonly)

Returns the value of attribute extension.



220
221
222
# File 'lib/openehr/rm/support/identification.rb', line 220

def extension
  @extension
end

#rootObject (readonly)

Returns the value of attribute root.



220
221
222
# File 'lib/openehr/rm/support/identification.rb', line 220

def root
  @root
end

Instance Method Details

#has_extension?Boolean

Returns:

  • (Boolean)


237
238
239
# File 'lib/openehr/rm/support/identification.rb', line 237

def has_extension?
  return !@extension.empty?
end

#value=(value) ⇒ Object



226
227
228
229
230
231
232
233
234
235
# File 'lib/openehr/rm/support/identification.rb', line 226

def value=(value)
  super(value)
  if /(\S+)::(\S+)/ =~ value
    @root = UID.new(:value => $1)
    @extension = $2
  else
    @root = UID.new(:value => value)
    @extension = ''
  end
end