Class: VORuby::VOTable::V1_1::Values

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

Overview

Holds subsidiary information about the domain of the data.

Constant Summary collapse

ELEMENT_NAME =
'VALUES'

Instance Attribute Summary

Attributes inherited from XML::Object::Base

#node

Class Method Summary collapse

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

Create some new subsidiary information about the domain.

values = Values.new(
  :id => 'RAdomain',
  :min => Min.new(:value => '0'),
  :max => Max.new(:value => '360', :inclusive => false)
)


1278
1279
1280
1281
# File 'lib/voruby/votable/1.1/votable.rb', line 1278

def initialize(defn=nil)
  super(defn)
  self.type = 'legal' if !self.type
end

Class Method Details

.serialization_orderObject



1265
1266
1267
1268
1269
1270
# File 'lib/voruby/votable/1.1/votable.rb', line 1265

def self.serialization_order
  [
    :min, :max, :options,
    :id, :type, :null, :ref
  ]
end

Instance Method Details

#idObject



1283
1284
1285
# File 'lib/voruby/votable/1.1/votable.rb', line 1283

def id
  self.node['ID']
end

#id=(i) ⇒ Object



1287
1288
1289
# File 'lib/voruby/votable/1.1/votable.rb', line 1287

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

#maxObject

Retrieve the maximum of the value (Max).



1321
1322
1323
# File 'lib/voruby/votable/1.1/votable.rb', line 1321

def max
  get_element(Max)
end

#max=(m) ⇒ Object

Set the maximum of the value (Max).



1326
1327
1328
# File 'lib/voruby/votable/1.1/votable.rb', line 1326

def max=(m)
  set_element(Max, m)
end

#minObject

Retrieve the minimum of the value (Min).



1331
1332
1333
# File 'lib/voruby/votable/1.1/votable.rb', line 1331

def min
  get_element(Min)
end

#min=(m) ⇒ Object

Set the minimum of the value (Min).



1336
1337
1338
# File 'lib/voruby/votable/1.1/votable.rb', line 1336

def min=(m)
  set_element(Min, m)
end

#nullObject



1302
1303
1304
# File 'lib/voruby/votable/1.1/votable.rb', line 1302

def null
  self.node['null']
end

#null=(n) ⇒ Object

Set the value that is used to specify non-existent data.



1308
1309
1310
# File 'lib/voruby/votable/1.1/votable.rb', line 1308

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

#optionsObject

Retrieve the possible values (Option) the column can take on. Returns a HomogeneousNodeList object.



1342
1343
1344
# File 'lib/voruby/votable/1.1/votable.rb', line 1342

def options
  HomogeneousNodeList.new(self.node, xpath_for(Option), Option)
end

#options=(opts) ⇒ Object

Set the possible values the column can take on.

values.options = [Option.new(), ...]


1348
1349
1350
# File 'lib/voruby/votable/1.1/votable.rb', line 1348

def options=(opts)
  self.options.replace(opts)
end

#refObject



1312
1313
1314
# File 'lib/voruby/votable/1.1/votable.rb', line 1312

def ref
  self.node['ref']
end

#ref=(r) ⇒ Object



1316
1317
1318
# File 'lib/voruby/votable/1.1/votable.rb', line 1316

def ref=(r)
  @node['ref'] = r.to_s
end

#typeObject



1291
1292
1293
# File 'lib/voruby/votable/1.1/votable.rb', line 1291

def type
  self.node['type']
end

#type=(t) ⇒ Object

Set the scope of values present. Possible values are: legal, actual. Defaults to legal.



1298
1299
1300
# File 'lib/voruby/votable/1.1/votable.rb', line 1298

def type=(t)
  @node['type'] = t.to_s
end