Class: VORuby::ADQL::V1_0::ColumnReference
- Inherits:
-
ScalarExpression
- Object
- SelectionItem
- ScalarExpression
- VORuby::ADQL::V1_0::ColumnReference
- Defined in:
- lib/voruby/adql/1.0/adql.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.
Class Method Summary collapse
Instance Method Summary collapse
- #==(r) ⇒ Object
-
#initialize(table, name, xpath_name = nil) ⇒ ColumnReference
constructor
A new instance of ColumnReference.
- #to_s ⇒ Object
- #to_xml(name = nil) ⇒ Object
Methods included from SerializableToXml
Constructor Details
#initialize(table, name, xpath_name = nil) ⇒ ColumnReference
Returns a new instance of ColumnReference.
207 208 209 210 211 212 |
# File 'lib/voruby/adql/1.0/adql.rb', line 207 def initialize(table, name, xpath_name=nil) super() self.table = table self.name = name self.xpath_name = xpath_name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
203 204 205 |
# File 'lib/voruby/adql/1.0/adql.rb', line 203 def name @name end |
#table ⇒ Object
Returns the value of attribute table.
203 204 205 |
# File 'lib/voruby/adql/1.0/adql.rb', line 203 def table @table end |
#xpath_name ⇒ Object
Returns the value of attribute xpath_name.
203 204 205 |
# File 'lib/voruby/adql/1.0/adql.rb', line 203 def xpath_name @xpath_name end |
Class Method Details
.from_xml(xml) ⇒ Object
248 249 250 251 252 253 254 255 256 257 |
# File 'lib/voruby/adql/1.0/adql.rb', line 248 def self.from_xml(xml) root = element_from(xml) xpath_name = root.attributes.get_attribute_ns(obj_ns.uri, 'xpathName') self.new( root.attributes.get_attribute_ns(obj_ns.uri, 'Table').value, root.attributes.get_attribute_ns(obj_ns.uri, 'Name').value, xpath_name ? xpath_name.value : nil ) end |
.xml_type ⇒ Object
205 |
# File 'lib/voruby/adql/1.0/adql.rb', line 205 def self.xml_type; 'columnReferenceType' end |
Instance Method Details
#==(r) ⇒ Object
242 243 244 245 246 |
# File 'lib/voruby/adql/1.0/adql.rb', line 242 def ==(r) self.table == r.table and self.name == r.name and self.xpath_name == r.xpath_name end |
#to_s ⇒ Object
238 239 240 |
# File 'lib/voruby/adql/1.0/adql.rb', line 238 def to_s "#{self.table}.#{self.name}" end |
#to_xml(name = nil) ⇒ Object
228 229 230 231 232 233 234 235 236 |
# File 'lib/voruby/adql/1.0/adql.rb', line 228 def to_xml(name=nil) el = super(name) el.attributes["#{obj_ns.prefix}:Table"] = self.table el.attributes["#{obj_ns.prefix}:Name"] = self.name el.attributes["#{obj_ns.prefix}:xpathName"] = self.xpath_name if self.xpath_name el end |