Class: Kumi::Core::Analyzer::Plans::Reduce
- Inherits:
-
Struct
- Object
- Struct
- Kumi::Core::Analyzer::Plans::Reduce
- Defined in:
- lib/kumi/core/analyzer/plans.rb
Overview
Reduce plan: defines how to reduce dimensions in array operations
Instance Attribute Summary collapse
-
#axis ⇒ Object
Returns the value of attribute axis.
-
#flatten_args ⇒ Object
Returns the value of attribute flatten_args.
-
#function ⇒ Object
Returns the value of attribute function.
-
#result_scope ⇒ Object
Returns the value of attribute result_scope.
-
#source_scope ⇒ Object
Returns the value of attribute source_scope.
Instance Method Summary collapse
-
#initialize(function:, axis: [], source_scope: [], result_scope: [], flatten_args: []) ⇒ Reduce
constructor
A new instance of Reduce.
- #partial_reduction? ⇒ Boolean
- #total_reduction? ⇒ Boolean
Constructor Details
#initialize(function:, axis: [], source_scope: [], result_scope: [], flatten_args: []) ⇒ Reduce
36 37 38 39 |
# File 'lib/kumi/core/analyzer/plans.rb', line 36 def initialize(function:, axis: [], source_scope: [], result_scope: [], flatten_args: []) super freeze end |
Instance Attribute Details
#axis ⇒ Object
Returns the value of attribute axis
35 36 37 |
# File 'lib/kumi/core/analyzer/plans.rb', line 35 def axis @axis end |
#flatten_args ⇒ Object
Returns the value of attribute flatten_args
35 36 37 |
# File 'lib/kumi/core/analyzer/plans.rb', line 35 def flatten_args @flatten_args end |
#function ⇒ Object
Returns the value of attribute function
35 36 37 |
# File 'lib/kumi/core/analyzer/plans.rb', line 35 def function @function end |
#result_scope ⇒ Object
Returns the value of attribute result_scope
35 36 37 |
# File 'lib/kumi/core/analyzer/plans.rb', line 35 def result_scope @result_scope end |
#source_scope ⇒ Object
Returns the value of attribute source_scope
35 36 37 |
# File 'lib/kumi/core/analyzer/plans.rb', line 35 def source_scope @source_scope end |
Instance Method Details
#partial_reduction? ⇒ Boolean
45 46 47 |
# File 'lib/kumi/core/analyzer/plans.rb', line 45 def partial_reduction? !total_reduction? end |
#total_reduction? ⇒ Boolean
41 42 43 |
# File 'lib/kumi/core/analyzer/plans.rb', line 41 def total_reduction? axis == :all || result_scope.empty? end |