Class: Kumi::Core::NAST::Fold
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.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #children ⇒ Object
-
#initialize(fn:, arg:, **k) ⇒ Fold
constructor
A new instance of Fold.
Methods inherited from Node
Constructor Details
#initialize(fn:, arg:, **k) ⇒ Fold
Returns a new instance of Fold.
196 197 198 199 200 |
# File 'lib/kumi/core/nast.rb', line 196 def initialize(fn:, arg:, **k) super(**k) @fn = fn.to_sym @arg = arg end |
Instance Attribute Details
#arg ⇒ Object (readonly)
Returns the value of attribute arg.
194 195 196 |
# File 'lib/kumi/core/nast.rb', line 194 def arg @arg end |
#fn ⇒ Object (readonly)
Returns the value of attribute fn.
194 195 196 |
# File 'lib/kumi/core/nast.rb', line 194 def fn @fn 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_fold) ? visitor.visit_fold(self) : super end |
#children ⇒ Object
206 |
# File 'lib/kumi/core/nast.rb', line 206 def children = [arg] |