Class: VORuby::VOTable::V1_1::Info

Inherits:
Base show all
Defined in:
lib/voruby/votable/1.1/votable.rb

Overview

A name-value pair.

Constant Summary collapse

ELEMENT_NAME =
'INFO'

Instance Attribute Summary

Attributes inherited from XML::Object::Base

#node

Instance Method Summary collapse

Methods inherited from Base

#==, element_name, #get_element, #xpath_for

Methods inherited from XML::Object::Base

#==, element_name, from_file, #to_s

Constructor Details

#initialize(defn = nil) ⇒ Info

Create a new name-value pair.

info = Info.new(:name => 'history', :value => 'my first observation')


480
481
482
# File 'lib/voruby/votable/1.1/votable.rb', line 480

def initialize(defn=nil)
  super(defn)
end

Instance Method Details

#idObject



484
485
486
# File 'lib/voruby/votable/1.1/votable.rb', line 484

def id
  self.node['ID']
end

#id=(i) ⇒ Object



488
489
490
# File 'lib/voruby/votable/1.1/votable.rb', line 488

def id=(i)
  @node['ID'] = i.to_s
end

#nameObject



492
493
494
# File 'lib/voruby/votable/1.1/votable.rb', line 492

def name
  self.node['name']
end

#name=(n) ⇒ Object



496
497
498
# File 'lib/voruby/votable/1.1/votable.rb', line 496

def name=(n)
  @node['name'] = n.to_s
end

#valueObject



500
501
502
# File 'lib/voruby/votable/1.1/votable.rb', line 500

def value
  self.node['value']
end

#value=(v) ⇒ Object



504
505
506
# File 'lib/voruby/votable/1.1/votable.rb', line 504

def value=(v)
  @node['value'] = v.to_s
end