Class: VORuby::ADQL::ScalarExpression
- Inherits:
-
SelectionItem
- Object
- SelectionItem
- VORuby::ADQL::ScalarExpression
- Defined in:
- lib/voruby/adql/adql.rb,
lib/voruby/adql/transforms.rb
Overview
The base type for a scalar expression.
Direct Known Subclasses
Atom, BinaryExpr, ClosedExpr, ColumnReference, FunctionType, UnaryExpr, UserDefinedFunction
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(val) ⇒ ScalarExpression
constructor
A new instance of ScalarExpression.
- #is_scalar?(v) ⇒ Boolean
- #to_adqls ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(val) ⇒ ScalarExpression
Returns a new instance of ScalarExpression.
77 78 79 |
# File 'lib/voruby/adql/adql.rb', line 77 def initialize(val) self.value = val end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
75 76 77 |
# File 'lib/voruby/adql/adql.rb', line 75 def value @value end |
Class Method Details
.from_xml(node) ⇒ Object
101 102 103 104 105 |
# File 'lib/voruby/adql/adql.rb', line 101 def self.from_xml(node) #type_s = node.attributes['xsi:type'] type_s = node.find_attribute('type', 'http://www.w3.org/2001/XMLSchema-instance') return ObjectBuilder.get_class_for(type_s).from_xml(node) end |
Instance Method Details
#is_scalar?(v) ⇒ Boolean
81 82 83 84 85 86 87 |
# File 'lib/voruby/adql/adql.rb', line 81 def is_scalar?(v) if v.is_a?(String) or v.is_a?(Integer) or v.is_a?(Float) return true else return false end end |
#to_adqls ⇒ Object
8 9 10 |
# File 'lib/voruby/adql/transforms.rb', line 8 def to_adqls self.value end |
#to_s ⇒ Object
97 98 99 |
# File 'lib/voruby/adql/adql.rb', line 97 def to_s "{value=#{self.value}}" end |