Class: Alf::Engine::InferHeading
- Inherits:
-
Object
- Object
- Alf::Engine::InferHeading
- Includes:
- Cog
- Defined in:
- lib/alf-engine/alf/engine/infer_heading.rb
Overview
Infers the heading of the iterated relation.
Instance Attribute Summary collapse
-
#operand ⇒ Enumerable
readonly
The operand.
Instance Method Summary collapse
- #_each {|heading.to_h| ... } ⇒ Object
-
#initialize(operand) ⇒ InferHeading
constructor
A new instance of InferHeading.
Methods included from Cog
Constructor Details
#initialize(operand) ⇒ InferHeading
Returns a new instance of InferHeading.
12 13 14 |
# File 'lib/alf-engine/alf/engine/infer_heading.rb', line 12 def initialize(operand) @operand = operand end |
Instance Attribute Details
#operand ⇒ Enumerable (readonly)
Returns The operand.
10 11 12 |
# File 'lib/alf-engine/alf/engine/infer_heading.rb', line 10 def operand @operand end |
Instance Method Details
#_each {|heading.to_h| ... } ⇒ Object
16 17 18 19 |
# File 'lib/alf-engine/alf/engine/infer_heading.rb', line 16 def _each heading = operand.inject(Alf::Heading::EMPTY){|h,t| h + heading(t) } yield(heading.to_h) end |