Class: Alf::Engine::Summarize::Hash
- Inherits:
-
Object
- Object
- Alf::Engine::Summarize::Hash
- Includes:
- Cog
- Defined in:
- lib/alf-engine/alf/engine/summarize/hash.rb
Instance Attribute Summary collapse
-
#allbut ⇒ Boolean
readonly
Make an allbut summarization?.
-
#by ⇒ AttrList
readonly
Summarization key.
-
#operand ⇒ Enumerable
readonly
The operand.
-
#summarization ⇒ Summarization
readonly
The summarization to use.
Instance Method Summary collapse
- #_each ⇒ Object
-
#initialize(operand, by, summarization, allbut) ⇒ Hash
constructor
Creates an Summarize::Hash instance.
Methods included from Cog
Constructor Details
#initialize(operand, by, summarization, allbut) ⇒ Hash
Creates an Summarize::Hash instance
19 20 21 22 23 24 |
# File 'lib/alf-engine/alf/engine/summarize/hash.rb', line 19 def initialize(operand, by, summarization, allbut) @operand = operand @by = by @summarization = summarization @allbut = allbut end |
Instance Attribute Details
#allbut ⇒ Boolean (readonly)
Returns Make an allbut summarization?.
16 17 18 |
# File 'lib/alf-engine/alf/engine/summarize/hash.rb', line 16 def allbut @allbut end |
#by ⇒ AttrList (readonly)
Returns Summarization key.
10 11 12 |
# File 'lib/alf-engine/alf/engine/summarize/hash.rb', line 10 def by @by end |
#operand ⇒ Enumerable (readonly)
Returns The operand.
7 8 9 |
# File 'lib/alf-engine/alf/engine/summarize/hash.rb', line 7 def operand @operand end |
#summarization ⇒ Summarization (readonly)
Returns The summarization to use.
13 14 15 |
# File 'lib/alf-engine/alf/engine/summarize/hash.rb', line 13 def summarization @summarization end |
Instance Method Details
#_each ⇒ Object
27 28 29 30 31 32 |
# File 'lib/alf-engine/alf/engine/summarize/hash.rb', line 27 def _each index = Materialize::Hash.new(operand, by, allbut) index.each_pair do |k, v| yield k.merge(summarization.summarize(v)) end end |