Class: VORuby::VOTable::V1_0::Option

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

Overview

An enumeration of possible values. Essentially a hierarchy of key-value pairs.

Constant Summary collapse

ELEMENT_NAME =
'OPTION'

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) ⇒ Option

Create a new enumeration.

option = Option.new(
  :name => 'author',
  :value => 'David Gasson'
)


1392
1393
1394
# File 'lib/voruby/votable/1.0/votable.rb', line 1392

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

Instance Method Details

#nameObject



1396
1397
1398
# File 'lib/voruby/votable/1.0/votable.rb', line 1396

def name
  self.node['name']
end

#name=(n) ⇒ Object



1400
1401
1402
# File 'lib/voruby/votable/1.0/votable.rb', line 1400

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

#valueObject



1404
1405
1406
# File 'lib/voruby/votable/1.0/votable.rb', line 1404

def value
  self.node['value']
end

#value=(v) ⇒ Object



1408
1409
1410
# File 'lib/voruby/votable/1.0/votable.rb', line 1408

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