Class: Alf::Engine::Ungroup
- Inherits:
-
Object
- Object
- Alf::Engine::Ungroup
- Includes:
- Cog
- Defined in:
- lib/alf-engine/alf/engine/ungroup.rb
Instance Attribute Summary collapse
-
#attribute ⇒ AttrName
readonly
Relation-valued attribute to ungroup.
-
#operand ⇒ Enumerable
readonly
The operand.
Instance Method Summary collapse
- #_each ⇒ Object
-
#initialize(operand, attribute) ⇒ Ungroup
constructor
Creates a Ungroup instance.
Methods included from Cog
Constructor Details
#initialize(operand, attribute) ⇒ Ungroup
Creates a Ungroup instance
13 14 15 16 |
# File 'lib/alf-engine/alf/engine/ungroup.rb', line 13 def initialize(operand, attribute) @operand = operand @attribute = attribute end |
Instance Attribute Details
#attribute ⇒ AttrName (readonly)
Returns Relation-valued attribute to ungroup.
10 11 12 |
# File 'lib/alf-engine/alf/engine/ungroup.rb', line 10 def attribute @attribute end |
#operand ⇒ Enumerable (readonly)
Returns The operand.
7 8 9 |
# File 'lib/alf-engine/alf/engine/ungroup.rb', line 7 def operand @operand end |
Instance Method Details
#_each ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/alf-engine/alf/engine/ungroup.rb', line 19 def _each operand.each do |tuple| tuple = tuple.dup tuple = tuple.to_hash unless tuple.is_a?(Hash) tuple.delete(@attribute).each do |subtuple| yield tuple.merge(subtuple) end end end |