Class: VORuby::ADQL::Table

Inherits:
FromTable show all
Defined in:
lib/voruby/adql/adql.rb,
lib/voruby/adql/transforms.rb

Overview

Represents a table with its name and its alias name.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, alias_name = nil, xpath_name = nil) ⇒ Table

Returns a new instance of Table.



837
838
839
840
841
# File 'lib/voruby/adql/adql.rb', line 837

def initialize(name, alias_name=nil, xpath_name=nil)
	self.name = name
	self.alias_name = alias_name
	self.xpath_name = xpath_name
end

Instance Attribute Details

#alias_nameObject

Returns the value of attribute alias_name.



835
836
837
# File 'lib/voruby/adql/adql.rb', line 835

def alias_name
  @alias_name
end

#nameObject

Returns the value of attribute name.



835
836
837
# File 'lib/voruby/adql/adql.rb', line 835

def name
  @name
end

#xpath_nameObject

Returns the value of attribute xpath_name.



835
836
837
# File 'lib/voruby/adql/adql.rb', line 835

def xpath_name
  @xpath_name
end

Class Method Details

.from_xml(node) ⇒ Object



847
848
849
850
# File 'lib/voruby/adql/adql.rb', line 847

def self.from_xml(node)
  type_s = node.find_attribute('type', 'http://www.w3.org/2001/XMLSchema-instance')
  table = ObjectBuilder.get_class_for(type_s).from_xml(node)
end

Instance Method Details

#to_adqlsObject



203
204
205
206
207
208
209
# File 'lib/voruby/adql/transforms.rb', line 203

def to_adqls
	if self.alias_name
		"#{self.name} #{self.alias_name}"
	else
		self.name
	end
end

#to_sObject



843
844
845
# File 'lib/voruby/adql/adql.rb', line 843

def to_s
	"{name=#{self.name},alias=#{self.alias_name},xpath=#{self.xpath_name}}"
end