Class: ActorSync::Adapters::Mixpanel::User
- Inherits:
-
Object
- Object
- ActorSync::Adapters::Mixpanel::User
- Defined in:
- lib/actor_sync/adapters/mixpanel.rb
Instance Method Summary collapse
- #call ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
-
#initialize(distinct_id, tracker, data, action) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(distinct_id, tracker, data, action) ⇒ User
Returns a new instance of User.
20 21 22 23 24 25 |
# File 'lib/actor_sync/adapters/mixpanel.rb', line 20 def initialize(distinct_id, tracker, data, action) @distinct_id = distinct_id @tracker = tracker @data = data @action = action end |
Instance Method Details
#call ⇒ Object
27 28 29 30 |
# File 'lib/actor_sync/adapters/mixpanel.rb', line 27 def call create if [:create, :update].include? @action destroy if @action == :destroy end |
#create ⇒ Object
32 33 34 |
# File 'lib/actor_sync/adapters/mixpanel.rb', line 32 def create @tracker.people.set(@distinct_id, @data) end |
#destroy ⇒ Object
36 37 38 |
# File 'lib/actor_sync/adapters/mixpanel.rb', line 36 def destroy @tracker.people.delete_user(@distinct_id) end |