Class: Kumi::Core::Analyzer::Plans::Reduce

Inherits:
Struct
  • Object
show all
Defined in:
lib/kumi/core/analyzer/plans.rb

Overview

Reduce plan: defines how to reduce dimensions in array operations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(function:, axis: [], source_scope: [], result_scope: [], flatten_args: []) ⇒ Reduce

Returns a new instance of Reduce.



35
36
37
38
# File 'lib/kumi/core/analyzer/plans.rb', line 35

def initialize(function:, axis: [], source_scope: [], result_scope: [], flatten_args: [])
  super
  freeze
end

Instance Attribute Details

#axisObject

Returns the value of attribute axis

Returns:

  • (Object)

    the current value of axis



34
35
36
# File 'lib/kumi/core/analyzer/plans.rb', line 34

def axis
  @axis
end

#flatten_argsObject

Returns the value of attribute flatten_args

Returns:

  • (Object)

    the current value of flatten_args



34
35
36
# File 'lib/kumi/core/analyzer/plans.rb', line 34

def flatten_args
  @flatten_args
end

#functionObject

Returns the value of attribute function

Returns:

  • (Object)

    the current value of function



34
35
36
# File 'lib/kumi/core/analyzer/plans.rb', line 34

def function
  @function
end

#result_scopeObject

Returns the value of attribute result_scope

Returns:

  • (Object)

    the current value of result_scope



34
35
36
# File 'lib/kumi/core/analyzer/plans.rb', line 34

def result_scope
  @result_scope
end

#source_scopeObject

Returns the value of attribute source_scope

Returns:

  • (Object)

    the current value of source_scope



34
35
36
# File 'lib/kumi/core/analyzer/plans.rb', line 34

def source_scope
  @source_scope
end

Instance Method Details

#partial_reduction?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/kumi/core/analyzer/plans.rb', line 44

def partial_reduction?
  !total_reduction?
end

#total_reduction?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/kumi/core/analyzer/plans.rb', line 40

def total_reduction?
  axis == :all || result_scope.empty?
end