Class: VORuby::ADQL::V1_0::Into

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

Overview

Represents the SQL INTO expression

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(table_name) ⇒ Into

Returns a new instance of Into.



1847
1848
1849
# File 'lib/voruby/adql/1.0/adql.rb', line 1847

def initialize(table_name)
  self.table_name = table_name
end

Instance Attribute Details

#table_nameObject

Returns the value of attribute table_name.



1843
1844
1845
# File 'lib/voruby/adql/1.0/adql.rb', line 1843

def table_name
  @table_name
end

Class Method Details

.from_xml(xml) ⇒ Object



1874
1875
1876
1877
1878
1879
1880
# File 'lib/voruby/adql/1.0/adql.rb', line 1874

def self.from_xml(xml)
  root = element_from(xml)
  
  self.new(
    REXML::XPath.first(root, 'x:TableName', {'x' => obj_ns.uri}).text
  )
end

.xml_typeObject



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

def self.xml_type; 'intoType' end

Instance Method Details

#==(i) ⇒ Object



1856
1857
1858
# File 'lib/voruby/adql/1.0/adql.rb', line 1856

def ==(i)
  self.table_name == i.table_name
end

#to_sObject



1860
1861
1862
# File 'lib/voruby/adql/1.0/adql.rb', line 1860

def to_s
  "INTO #{self.table_name}"
end

#to_xml(name = nil) ⇒ Object



1864
1865
1866
1867
1868
1869
1870
1871
1872
# File 'lib/voruby/adql/1.0/adql.rb', line 1864

def to_xml(name=nil)
  el = element_root(name)
  
  name = REXML::Element.new("#{obj_ns.prefix}:TableName")
  name.text = self.table_name
  el.add_element(name)
  
  el
end