Class: VORuby::VOTable::V1_0::Definitions

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

Overview

Definitions of various values appropriate to the votable.

Constant Summary collapse

ELEMENT_NAME =
'DEFINITIONS'

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

Create a set of definitions.

definitions = Definitions.new(
  :coordinate_systems => [Coosys.new]
  :params => [Param.new]
)


193
194
195
# File 'lib/voruby/votable/1.0/votable.rb', line 193

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

Instance Method Details

#coordinate_systemsObject

Retrieve the coordinate systems (Coosys). Returns a HomogeneousNodeList.



199
200
201
# File 'lib/voruby/votable/1.0/votable.rb', line 199

def coordinate_systems
  HomogeneousNodeList.new(self.node, xpath_for(Coosys), Coosys)
end

#coordinate_systems=(systems) ⇒ Object

Retrieve the parameters (Param). Returns a HomogeneousNodeList.



205
206
207
# File 'lib/voruby/votable/1.0/votable.rb', line 205

def coordinate_systems=(systems)
  self.coordinate_systems.replace(systems)
end

#paramsObject

Retrieve the parameters (Param). Returns a HomogeneousNodeList.



211
212
213
# File 'lib/voruby/votable/1.0/votable.rb', line 211

def params
  HomogeneousNodeList.new(self.node, xpath_for(Param), Param)
end

#params=(parameters) ⇒ Object

Set the parameter list. Takes an array of Param objects.

definitions.params = [Param.new(), ...]


218
219
220
# File 'lib/voruby/votable/1.0/votable.rb', line 218

def params=(parameters)
  self.params.replace(parameters)
end