Class: VORuby::ADQL::V1_0::SelectionOption

Inherits:
Object
  • Object
show all
Includes:
SerializableToXml
Defined in:
lib/voruby/adql/1.0/adql.rb

Overview

Option of selecting all or distinct elements in a query

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(option) ⇒ SelectionOption

Returns a new instance of SelectionOption.



430
431
432
# File 'lib/voruby/adql/1.0/adql.rb', line 430

def initialize(option)
  self.option = option
end

Instance Attribute Details

#optionObject

Returns the value of attribute option.



426
427
428
# File 'lib/voruby/adql/1.0/adql.rb', line 426

def option
  @option
end

Class Method Details

.from_xml(xml) ⇒ Object



457
458
459
460
461
462
463
# File 'lib/voruby/adql/1.0/adql.rb', line 457

def self.from_xml(xml)
  root = element_from(xml)
  
  self.new(
    AllOrDistinct.new(root.attributes.get_attribute_ns(obj_ns.uri, 'Option').value)
  )
end

.xml_typeObject



428
# File 'lib/voruby/adql/1.0/adql.rb', line 428

def self.xml_type; 'selectionOptionType' end

Instance Method Details

#==(o) ⇒ Object



443
444
445
# File 'lib/voruby/adql/1.0/adql.rb', line 443

def ==(o)
  self.option == o.option
end

#to_sObject



447
448
449
# File 'lib/voruby/adql/1.0/adql.rb', line 447

def to_s
  self.option.to_s
end

#to_xml(name = nil) ⇒ Object



451
452
453
454
455
# File 'lib/voruby/adql/1.0/adql.rb', line 451

def to_xml(name=nil)
  el = element_root(name)
  el.attributes["#{obj_ns.prefix}:Option"] = self.option.to_s
  el
end