Module: Wonkavision::Plugins::Facts::ClassMethods
- Defined in:
- lib/wonkavision/plugins/analytics/facts.rb
Instance Method Summary collapse
- #accept(event_path, options = {}, &mapping_block) ⇒ Object
- #output_event_path(new_path = nil) ⇒ Object
- #record_id(new_record_id = nil) ⇒ Object
- #store(new_store = nil) ⇒ Object
Instance Method Details
#accept(event_path, options = {}, &mapping_block) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/wonkavision/plugins/analytics/facts.rb', line 26 def accept(event_path, ={}, &mapping_block) map(event_path, &mapping_block) if mapping_block handle event_path do accept_event(event_context.data, ) end end |
#output_event_path(new_path = nil) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/wonkavision/plugins/analytics/facts.rb', line 17 def output_event_path(new_path=nil) if new_path [:output_event_path] = new_path else [:output_event_path] ||= Wonkavision.join('wv','analytics','facts','updated') end end |
#record_id(new_record_id = nil) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/wonkavision/plugins/analytics/facts.rb', line 33 def record_id(new_record_id=nil) if new_record_id [:record_id] = new_record_id else [:record_id] ||= "id" end end |
#store(new_store = nil) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/wonkavision/plugins/analytics/facts.rb', line 41 def store(new_store=nil) if new_store store = new_store.kind_of?(Wonkavision::Analytics::Persistence::Store) ? store : Wonkavision::Analytics::Persistence::Store[new_store] raise "Could not find a storage type of #{new_store}" unless store store = store.new(self) if store.respond_to?(:new) [:store] = store else [:store] end end |