Class: VORuby::ADQL::ClosedExpr

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

Overview

Represents an expression inside a bracket.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ScalarExpression

#is_scalar?, #to_s

Constructor Details

#initialize(val) ⇒ ClosedExpr

Returns a new instance of ClosedExpr.



112
113
114
# File 'lib/voruby/adql/adql.rb', line 112

def initialize(val)
	self.value = val
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



110
111
112
# File 'lib/voruby/adql/adql.rb', line 110

def value
  @value
end

Class Method Details

.from_xml(node) ⇒ Object



121
122
123
124
125
# File 'lib/voruby/adql/adql.rb', line 121

def self.from_xml(node)
 expr_node = REXML::XPath.first(node, 'Arg')
 expr = ScalarExpression.from_xml(expr_node)
 return ClosedExpr.new(expr)
end

Instance Method Details

#to_adqlsObject



14
15
16
# File 'lib/voruby/adql/transforms.rb', line 14

def to_adqls
	"(#{self.value.to_adqls})"
end