Class: VORuby::ADQL::ColumnReference
- Inherits:
-
ScalarExpression
- Object
- SelectionItem
- ScalarExpression
- VORuby::ADQL::ColumnReference
- Defined in:
- lib/voruby/adql/adql.rb,
lib/voruby/adql/transforms.rb
Overview
Represents a column.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#table ⇒ Object
Returns the value of attribute table.
-
#xpath_name ⇒ Object
Returns the value of attribute xpath_name.
Attributes inherited from ScalarExpression
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(table, name, xpath_name = nil) ⇒ ColumnReference
constructor
A new instance of ColumnReference.
- #to_adqls ⇒ Object
- #to_adqlx(element_name) ⇒ Object
- #to_s ⇒ Object
Methods inherited from ScalarExpression
Constructor Details
#initialize(table, name, xpath_name = nil) ⇒ ColumnReference
Returns a new instance of ColumnReference.
280 281 282 283 284 285 286 |
# File 'lib/voruby/adql/adql.rb', line 280 def initialize(table, name, xpath_name=nil) super("#{table}.#{name} #{xpath_name || ''}") self.table = table self.name = name self.xpath_name = xpath_name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
278 279 280 |
# File 'lib/voruby/adql/adql.rb', line 278 def name @name end |
#table ⇒ Object
Returns the value of attribute table.
278 279 280 |
# File 'lib/voruby/adql/adql.rb', line 278 def table @table end |
#xpath_name ⇒ Object
Returns the value of attribute xpath_name.
278 279 280 |
# File 'lib/voruby/adql/adql.rb', line 278 def xpath_name @xpath_name end |
Class Method Details
.from_xml(el) ⇒ Object
292 293 294 295 296 297 |
# File 'lib/voruby/adql/adql.rb', line 292 def self.from_xml(el) table = el.attributes['Table'] name = el.attributes['Name'] xpath = el.attributes['xpathName'] cr = ColumnReference.new(table, name, xpath) end |
Instance Method Details
#to_adqls ⇒ Object
44 45 46 |
# File 'lib/voruby/adql/transforms.rb', line 44 def to_adqls "#{self.table}.#{self.name}" end |
#to_adqlx(element_name) ⇒ Object
48 49 50 51 |
# File 'lib/voruby/adql/transforms.rb', line 48 def to_adqlx(element_name) "<#{element_name} Name=\"#{self.name}\" Table=\"#{self.table}\" " + "xsi:type=\"columnReferenceType\"/>" end |
#to_s ⇒ Object
288 289 290 |
# File 'lib/voruby/adql/adql.rb', line 288 def to_s self.value end |