Class: Kumi::Core::NAST::Reduce

Inherits:
Node
  • Object
show all
Defined in:
lib/kumi/core/nast.rb

Overview

Semantic reduction over explicit axes, with kernel id (e.g., :“agg.sum”)

Instance Attribute Summary collapse

Attributes inherited from Node

#id, #loc, #meta

Instance Method Summary collapse

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

#argObject (readonly)

Returns the value of attribute arg.



193
194
195
# File 'lib/kumi/core/nast.rb', line 193

def arg
  @arg
end

#fnObject (readonly)

Returns the value of attribute fn.



193
194
195
# File 'lib/kumi/core/nast.rb', line 193

def fn
  @fn
end

#overObject (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