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.



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

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

Instance Attribute Details

#extensionObject (readonly)

Returns the value of attribute extension.



218
219
220
# File 'lib/openehr/rm/support/identification.rb', line 218

def extension
  @extension
end

#rootObject (readonly)

Returns the value of attribute root.



218
219
220
# File 'lib/openehr/rm/support/identification.rb', line 218

def root
  @root
end

Instance Method Details

#has_extension?Boolean

Returns:

  • (Boolean)


235
236
237
# File 'lib/openehr/rm/support/identification.rb', line 235

def has_extension?
  return !@extension.empty?
end

#value=(value) ⇒ Object



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

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