Class: IdRef

Inherits:
Object
  • Object
show all
Includes:
SerializableToXml
Defined in:
lib/voruby/misc.rb

Overview

Basic IDREF

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(ref) ⇒ IdRef

Returns a new instance of IdRef.



255
256
257
# File 'lib/voruby/misc.rb', line 255

def initialize(ref)
  self.value = ref
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



253
254
255
# File 'lib/voruby/misc.rb', line 253

def value
  @value
end

Class Method Details

.from_xml(xml) ⇒ Object



278
279
280
# File 'lib/voruby/misc.rb', line 278

def self.from_xml(xml)
  self.new(element_from(xml).text)
end

Instance Method Details

#==(id) ⇒ Object



268
269
270
# File 'lib/voruby/misc.rb', line 268

def ==(id)
  self.value == id.value
end

#to_sObject



264
265
266
# File 'lib/voruby/misc.rb', line 264

def to_s
  self.value.to_s
end

#to_xml(name = nil) ⇒ Object



272
273
274
275
276
# File 'lib/voruby/misc.rb', line 272

def to_xml(name=nil)
  el = element(name)
  el.text = self.value.to_s
  el
end