Class: VORuby::ADQL::UnaryExpr
- Inherits:
-
ScalarExpression
- Object
- SelectionItem
- ScalarExpression
- VORuby::ADQL::UnaryExpr
- Defined in:
- lib/voruby/adql/adql.rb,
lib/voruby/adql/transforms.rb
Overview
Represents an unary expression such as -(a.ra)
Instance Attribute Summary collapse
-
#arg ⇒ Object
Returns the value of attribute arg.
-
#oper ⇒ Object
Returns the value of attribute oper.
Attributes inherited from ScalarExpression
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(oper, arg) ⇒ UnaryExpr
constructor
A new instance of UnaryExpr.
- #to_adqls ⇒ Object
- #to_s ⇒ Object
Methods inherited from ScalarExpression
Constructor Details
#initialize(oper, arg) ⇒ UnaryExpr
Returns a new instance of UnaryExpr.
237 238 239 240 241 242 |
# File 'lib/voruby/adql/adql.rb', line 237 def initialize(oper, arg) super("#{oper}#{arg}") self.arg = arg self.oper = oper end |
Instance Attribute Details
#arg ⇒ Object
Returns the value of attribute arg.
235 236 237 |
# File 'lib/voruby/adql/adql.rb', line 235 def arg @arg end |
#oper ⇒ Object
Returns the value of attribute oper.
235 236 237 |
# File 'lib/voruby/adql/adql.rb', line 235 def oper @oper end |
Class Method Details
.from_xml(node) ⇒ Object
268 269 270 271 272 273 |
# File 'lib/voruby/adql/adql.rb', line 268 def self.from_xml(node) oper = UnaryOperator.new(node.attributes['Oper']) arg_node = REXML::XPath.first(node, 'Arg') arg = ScalarExpression.from_xml(arg_node) return UnaryExpr.new(oper, arg) end |