Class: Wonkavision::Analytics::Persistence::HashStore

Inherits:
Store
  • Object
show all
Defined in:
lib/wonkavision/plugins/analytics/persistence/hash_store.rb

Instance Attribute Summary collapse

Attributes inherited from Store

#owner

Instance Method Summary collapse

Methods inherited from Store

[], []=, #add_facts, #execute_query, inherited, #remove_facts, #update_aggregation, #update_facts

Constructor Details

#initialize(facts, storage = HashWithIndifferentAccess.new) ⇒ HashStore

Returns a new instance of HashStore.



7
8
9
10
# File 'lib/wonkavision/plugins/analytics/persistence/hash_store.rb', line 7

def initialize(facts, storage = HashWithIndifferentAccess.new)
  super(facts)
  @storage = storage
end

Instance Attribute Details

#storageObject (readonly)

Returns the value of attribute storage.



6
7
8
# File 'lib/wonkavision/plugins/analytics/persistence/hash_store.rb', line 6

def storage
  @storage
end

Instance Method Details

#aggregationsObject



12
13
14
# File 'lib/wonkavision/plugins/analytics/persistence/hash_store.rb', line 12

def aggregations
  @storage[:aggregations] ||= {}
end