Class: VORuby::ADQL::AggregateFunction
- Inherits:
-
FunctionType
- Object
- SelectionItem
- ScalarExpression
- FunctionType
- VORuby::ADQL::AggregateFunction
- Defined in:
- lib/voruby/adql/adql.rb,
lib/voruby/adql/transforms.rb
Overview
Represents an aggregate function.
Instance Attribute Summary collapse
-
#allow ⇒ Object
Returns the value of attribute allow.
-
#arg ⇒ Object
Returns the value of attribute arg.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from ScalarExpression
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, arg, allow = nil) ⇒ AggregateFunction
constructor
A new instance of AggregateFunction.
- #to_adqls ⇒ Object
- #to_s ⇒ Object
Methods inherited from ScalarExpression
Constructor Details
#initialize(name, arg, allow = nil) ⇒ AggregateFunction
Returns a new instance of AggregateFunction.
649 650 651 652 653 |
# File 'lib/voruby/adql/adql.rb', line 649 def initialize(name, arg, allow=nil) self.name = name self.arg = arg self.allow = allow end |
Instance Attribute Details
#allow ⇒ Object
Returns the value of attribute allow.
647 648 649 |
# File 'lib/voruby/adql/adql.rb', line 647 def allow @allow end |
#arg ⇒ Object
Returns the value of attribute arg.
647 648 649 |
# File 'lib/voruby/adql/adql.rb', line 647 def arg @arg end |
#name ⇒ Object
Returns the value of attribute name.
647 648 649 |
# File 'lib/voruby/adql/adql.rb', line 647 def name @name end |
Class Method Details
.from_xml(node) ⇒ Object
679 680 681 682 683 684 685 686 687 688 689 |
# File 'lib/voruby/adql/adql.rb', line 679 def self.from_xml(node) name = AggregateFunctionName.from_xml(node) arg_node = REXML::XPath.first(node, 'Arg') arg = Arg.from_xml(arg_node) allow_node = REXML::XPath.first(node, 'Allow') allow = nil if allow_node allow = Allow.from_xml(allow_node) end return AggregateFunction.new(name, arg, allow) end |
Instance Method Details
#to_adqls ⇒ Object
143 144 145 146 147 148 149 |
# File 'lib/voruby/adql/transforms.rb', line 143 def to_adqls if self.allow "#{self.name.to_adqls}(#{self.allow.to_adqls} #{self.arg.to_adqls})" else "#{self.name.to_adqls}(#{self.arg.to_adqls})" end end |
#to_s ⇒ Object
675 676 677 |
# File 'lib/voruby/adql/adql.rb', line 675 def to_s "{name=#{self.name},arg=#{self.arg},allow=#{self.allow}}" end |