Class: Wherever
- Inherits:
-
Object
- Object
- Wherever
- Defined in:
- lib/wherever/wherever.rb,
lib/wherever/wherever/mark.rb,
lib/wherever/wherever/adder.rb,
lib/wherever/wherever/getter.rb,
lib/wherever/wherever/lookup.rb,
lib/wherever/wherever/accessors.rb,
lib/wherever/wherever/recalculate.rb
Defined Under Namespace
Modules: Accessors, Adder, Getter, Lookup, Mark, Recalculate
Constant Summary collapse
- LogMethods =
[:add, :get, :get_key_store, :mark]
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#marker ⇒ Object
readonly
Returns the value of attribute marker.
Instance Method Summary collapse
- #add_grouping(&grouping) ⇒ Object
- #add_summing(key, options) ⇒ Object
-
#initialize(options = {}, &grouping) ⇒ Wherever
constructor
A new instance of Wherever.
Methods included from Mark
Methods included from Recalculate
#recalculate, #recalculate_identifier, #recalculate_with_key, #sum_group_for
Methods included from Lookup
Methods included from Getter
Methods included from Adder
Methods included from Accessors
Constructor Details
#initialize(options = {}, &grouping) ⇒ Wherever
Returns a new instance of Wherever.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/wherever/wherever.rb', line 16 def initialize(={}, &grouping) @config = Configure.new() @marker = [:marker] || 'current' if block_given? @grouping = grouping else @grouping = lambda do |values, data, record, keys| data.keys.each do |key| values[key] += data[key] end end end @summing = {} if ['method_logging'] MethodLogging.add(self.class) end end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
12 13 14 |
# File 'lib/wherever/wherever.rb', line 12 def config @config end |
#marker ⇒ Object (readonly)
Returns the value of attribute marker.
12 13 14 |
# File 'lib/wherever/wherever.rb', line 12 def marker @marker end |
Instance Method Details
#add_grouping(&grouping) ⇒ Object
34 35 36 |
# File 'lib/wherever/wherever.rb', line 34 def add_grouping(&grouping) @grouping = grouping end |
#add_summing(key, options) ⇒ Object
38 39 40 |
# File 'lib/wherever/wherever.rb', line 38 def add_summing(key, ) @summing[key] = end |