Class: VORuby::ADQL::ScalarExpression

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

Overview

The base type for a scalar expression.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#valueObject

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

Returns:

  • (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_adqlsObject



8
9
10
# File 'lib/voruby/adql/transforms.rb', line 8

def to_adqls
	self.value
end

#to_sObject



97
98
99
# File 'lib/voruby/adql/adql.rb', line 97

def to_s
	"{value=#{self.value}}"
end