Class: MetricsAdapter::Adapters::Mixpanel
- Inherits:
-
Object
- Object
- MetricsAdapter::Adapters::Mixpanel
- Defined in:
- lib/metrics_adapter/adapters/mixpanel.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#tracker ⇒ Object
readonly
Returns the value of attribute tracker.
Instance Method Summary collapse
-
#initialize(options) ⇒ Mixpanel
constructor
A new instance of Mixpanel.
- #publish(data) ⇒ Object
Constructor Details
#initialize(options) ⇒ Mixpanel
Returns a new instance of Mixpanel.
6 7 8 9 |
# File 'lib/metrics_adapter/adapters/mixpanel.rb', line 6 def initialize() @tracker = ::Mixpanel::Tracker.new(.fetch(:secret)) @logger = ::MetricsAdapter.logger end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
4 5 6 |
# File 'lib/metrics_adapter/adapters/mixpanel.rb', line 4 def logger @logger end |
#tracker ⇒ Object (readonly)
Returns the value of attribute tracker.
4 5 6 |
# File 'lib/metrics_adapter/adapters/mixpanel.rb', line 4 def tracker @tracker end |
Instance Method Details
#publish(data) ⇒ Object
11 12 13 14 15 |
# File 'lib/metrics_adapter/adapters/mixpanel.rb', line 11 def publish(data) id = data.delete(:id) name = data.delete(:name) tracker.track(id, name, data) end |