Class: VORuby::ADQL::V1_0::SelectionLimit

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

Overview

Represents the TOP part of a query

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(top) ⇒ SelectionLimit

Returns a new instance of SelectionLimit.



1806
1807
1808
# File 'lib/voruby/adql/1.0/adql.rb', line 1806

def initialize(top)
  self.top = top
end

Instance Attribute Details

#topObject

Returns the value of attribute top.



1802
1803
1804
# File 'lib/voruby/adql/1.0/adql.rb', line 1802

def top
  @top
end

Class Method Details

.from_xml(xml) ⇒ Object



1829
1830
1831
1832
1833
1834
1835
1836
# File 'lib/voruby/adql/1.0/adql.rb', line 1829

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

.xml_typeObject



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

def self.xml_type; 'selectionLimitType' end

Instance Method Details

#==(l) ⇒ Object



1815
1816
1817
# File 'lib/voruby/adql/1.0/adql.rb', line 1815

def ==(l)
  self.top == l.top
end

#to_sObject



1819
1820
1821
# File 'lib/voruby/adql/1.0/adql.rb', line 1819

def to_s
  "TOP #{self.top}"
end

#to_xml(name = nil) ⇒ Object



1823
1824
1825
1826
1827
# File 'lib/voruby/adql/1.0/adql.rb', line 1823

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