Class: Id

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

Overview

Basic ID

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(ref) ⇒ Id

Returns a new instance of Id.



289
290
291
# File 'lib/voruby/misc.rb', line 289

def initialize(ref)
  self.value = ref
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



285
286
287
# File 'lib/voruby/misc.rb', line 285

def value
  @value
end

Class Method Details

.from_xml(xml) ⇒ Object



312
313
314
# File 'lib/voruby/misc.rb', line 312

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

Instance Method Details

#==(id) ⇒ Object



302
303
304
# File 'lib/voruby/misc.rb', line 302

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

#to_sObject



298
299
300
# File 'lib/voruby/misc.rb', line 298

def to_s
  self.value.to_s
end

#to_xml(name = nil) ⇒ Object



306
307
308
309
310
# File 'lib/voruby/misc.rb', line 306

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