Class: VORuby::VOTable::V1_1::FieldRef
- Inherits:
-
Base
- Object
- XML::Object::Base
- Base
- VORuby::VOTable::V1_1::FieldRef
- Defined in:
- lib/voruby/votable/1.1/votable.rb
Overview
A reference to an existing Field.
Constant Summary collapse
- ELEMENT_NAME =
'FIELDref'
Instance Attribute Summary
Attributes inherited from XML::Object::Base
Instance Method Summary collapse
-
#field ⇒ Object
Retrieve the field (Field) associated with this reference.
-
#initialize(defn = nil) ⇒ FieldRef
constructor
Create a new field reference.
- #ref ⇒ Object
- #ref=(r) ⇒ 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
Instance Method Details
#field ⇒ Object
Retrieve the field (Field) associated with this reference.
1668 1669 1670 1671 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1668 def field field_node = self.node.find_first("ancestor::*/FIELD[@ID='#{self.ref}']") field_node ? Field.new(field_node) : nil end |
#ref ⇒ Object
1659 1660 1661 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1659 def ref self.node['ref'] end |
#ref=(r) ⇒ Object
1663 1664 1665 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1663 def ref=(r) @node['ref'] = r.to_s end |