Module: TrackerJacker::Trackable::ClassMethods
- Defined in:
- lib/tracker_jacker/trackable.rb
Instance Method Summary collapse
- #analytic_attribute_tracking_callbacks ⇒ Object
- #analytic_event_tracking_callbacks ⇒ Object
- #track_attribute(attribute, options = {}) ⇒ Object
- #track_attributes(attributes, options = {}) ⇒ Object
- #track_event(event, options = {}) ⇒ Object
Instance Method Details
#analytic_attribute_tracking_callbacks ⇒ Object
19 20 21 |
# File 'lib/tracker_jacker/trackable.rb', line 19 def analytic_attribute_tracking_callbacks @analytic_attribute_tracking_callbacks ||= {} end |
#analytic_event_tracking_callbacks ⇒ Object
15 16 17 |
# File 'lib/tracker_jacker/trackable.rb', line 15 def analytic_event_tracking_callbacks @analytic_event_tracking_callbacks ||= {} end |
#track_attribute(attribute, options = {}) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/tracker_jacker/trackable.rb', line 31 def track_attribute(attribute, = {}) owner_method = .fetch(:owner) category = .fetch(:category) analytic_attribute_tracking_callbacks[attribute] = AttributeTrackingCallback.new(attribute, owner_method, category) end |
#track_attributes(attributes, options = {}) ⇒ Object
38 39 40 |
# File 'lib/tracker_jacker/trackable.rb', line 38 def track_attributes(attributes, = {}) attributes.each {|attr| track_attribute(attr, )} end |
#track_event(event, options = {}) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/tracker_jacker/trackable.rb', line 23 def track_event(event, = {}) if_proc = .fetch(:if) owner_method = .fetch(:owner) category = .fetch(:category) analytic_event_tracking_callbacks[event] = EventTrackingCallback.new(event, if_proc, owner_method, category) end |