Class: Rgviz::AggregateColumn
- Inherits:
-
Object
- Object
- Rgviz::AggregateColumn
- Defined in:
- lib/rgviz/nodes.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#argument ⇒ Object
Returns the value of attribute argument.
-
#function ⇒ Object
Returns the value of attribute function.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #eql?(other) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(function, argument) ⇒ AggregateColumn
constructor
A new instance of AggregateColumn.
- #to_s ⇒ Object
Constructor Details
#initialize(function, argument) ⇒ AggregateColumn
Returns a new instance of AggregateColumn.
485 486 487 488 |
# File 'lib/rgviz/nodes.rb', line 485 def initialize(function, argument) @function = function @argument = argument end |
Instance Attribute Details
#argument ⇒ Object
Returns the value of attribute argument.
483 484 485 |
# File 'lib/rgviz/nodes.rb', line 483 def argument @argument end |
#function ⇒ Object
Returns the value of attribute function.
482 483 484 |
# File 'lib/rgviz/nodes.rb', line 482 def function @function end |
Instance Method Details
#accept(visitor) ⇒ Object
490 491 492 493 494 495 |
# File 'lib/rgviz/nodes.rb', line 490 def accept(visitor) if visitor.visit_aggregate_column(self) argument.accept visitor end visitor.end_visit_aggregate_column self end |
#eql?(other) ⇒ Boolean Also known as: ==
505 506 507 |
# File 'lib/rgviz/nodes.rb', line 505 def eql?(other) other.class == ScalarFunctionColumn && other.function == @function && other.arguments == @arguments end |
#hash ⇒ Object
497 498 499 500 501 502 503 |
# File 'lib/rgviz/nodes.rb', line 497 def hash return @hash if @hash @hash = 1 @hash = @hash * 31 + @function.hash @hash = @hash * 31 + @argument.hash @hash end |
#to_s ⇒ Object
511 512 513 |
# File 'lib/rgviz/nodes.rb', line 511 def to_s "#{function}(#{argument})" end |