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
- #children ⇒ Object
-
#initialize(fn:, over:, arg:, **k) ⇒ Reduce
constructor
A new instance of Reduce.
Methods inherited from Node
Constructor Details
#initialize(fn:, over:, arg:, **k) ⇒ Reduce
Returns a new instance of Reduce.
213 214 215 216 217 218 |
# File 'lib/kumi/core/nast.rb', line 213 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.
211 212 213 |
# File 'lib/kumi/core/nast.rb', line 211 def arg @arg end |
#fn ⇒ Object (readonly)
Returns the value of attribute fn.
211 212 213 |
# File 'lib/kumi/core/nast.rb', line 211 def fn @fn end |
#over ⇒ Object (readonly)
Returns the value of attribute over.
211 212 213 |
# File 'lib/kumi/core/nast.rb', line 211 def over @over end |
Instance Method Details
#accept(visitor) ⇒ Object
220 221 222 |
# File 'lib/kumi/core/nast.rb', line 220 def accept(visitor) visitor.respond_to?(:visit_reduce) ? visitor.visit_reduce(self) : super end |
#children ⇒ Object
224 |
# File 'lib/kumi/core/nast.rb', line 224 def children = [arg] |