Class: Kumi::Core::NAST::Reduce
- Defined in:
- lib/kumi/core/nast.rb
Overview
Semantic reduction over explicit axes, with kernel id (e.g., :“agg.sum”)
Instance Attribute Summary collapse
-
#arg ⇒ Object
readonly
Returns the value of attribute arg.
-
#fn ⇒ Object
readonly
Returns the value of attribute fn.
-
#over ⇒ Object
readonly
Returns the value of attribute over.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(fn:, over:, arg:, **k) ⇒ Reduce
constructor
A new instance of Reduce.
Constructor Details
#initialize(fn:, over:, arg:, **k) ⇒ Reduce
Returns a new instance of Reduce.
195 196 197 198 199 200 |
# File 'lib/kumi/core/nast.rb', line 195 def initialize(fn:, over:, arg:, **k) super(**k) @fn = fn.to_sym @over = Array(over).map!(&:to_sym) @arg = arg end |
Instance Attribute Details
#arg ⇒ Object (readonly)
Returns the value of attribute arg.
193 194 195 |
# File 'lib/kumi/core/nast.rb', line 193 def arg @arg end |
#fn ⇒ Object (readonly)
Returns the value of attribute fn.
193 194 195 |
# File 'lib/kumi/core/nast.rb', line 193 def fn @fn end |
#over ⇒ Object (readonly)
Returns the value of attribute over.
193 194 195 |
# File 'lib/kumi/core/nast.rb', line 193 def over @over end |
Instance Method Details
#accept(visitor) ⇒ Object
202 203 204 |
# File 'lib/kumi/core/nast.rb', line 202 def accept(visitor) visitor.respond_to?(:visit_reduce) ? visitor.visit_reduce(self) : super end |