Class: VORuby::VOTable::V1_1::Option
- Inherits:
-
Base
- Object
- XML::Object::Base
- Base
- VORuby::VOTable::V1_1::Option
- Defined in:
- lib/voruby/votable/1.1/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
Instance Method Summary collapse
-
#initialize(defn = nil) ⇒ Option
constructor
Create a new enumeration.
- #name ⇒ Object
- #name=(n) ⇒ Object
-
#options ⇒ Object
Retrieve any sub-options (Option).
-
#options=(opts) ⇒ Object
Set any sub-options.
- #value ⇒ Object
- #value=(v) ⇒ Object
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
1475 1476 1477 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1475 def initialize(defn=nil) super(defn) end |
Instance Method Details
#name ⇒ Object
1479 1480 1481 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1479 def name self.node['name'] end |
#name=(n) ⇒ Object
1483 1484 1485 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1483 def name=(n) @node['name'] = n.to_s end |
#options ⇒ Object
Retrieve any sub-options (Option). Returns a HomogeneousNodeList.
1497 1498 1499 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1497 def HomogeneousNodeList.new(self.node, xpath_for(Option), Option) end |
#options=(opts) ⇒ Object
Set any sub-options. option.options = [Option.new(), …]
1503 1504 1505 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1503 def (opts) self..replace(opts) end |
#value ⇒ Object
1487 1488 1489 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1487 def value self.node['value'] end |
#value=(v) ⇒ Object
1491 1492 1493 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1491 def value=(v) @node['value'] = v.to_s end |