Class: ActorSync::Adapters::Mixpanel::Group
- Inherits:
-
Object
- Object
- ActorSync::Adapters::Mixpanel::Group
- Defined in:
- lib/actor_sync/adapters/mixpanel.rb
Instance Method Summary collapse
- #call ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
-
#initialize(group_key, group_id, tracker, data, action) ⇒ Group
constructor
A new instance of Group.
Constructor Details
#initialize(group_key, group_id, tracker, data, action) ⇒ Group
Returns a new instance of Group.
42 43 44 45 46 47 48 |
# File 'lib/actor_sync/adapters/mixpanel.rb', line 42 def initialize(group_key, group_id, tracker, data, action) @group_key = group_key @group_id = group_id @tracker = tracker @data = data @action = action end |
Instance Method Details
#call ⇒ Object
50 51 52 53 |
# File 'lib/actor_sync/adapters/mixpanel.rb', line 50 def call create if [:create, :update].include? @action destroy if @action == :destroy end |
#create ⇒ Object
55 56 57 |
# File 'lib/actor_sync/adapters/mixpanel.rb', line 55 def create @tracker.groups.set(@group_key, @group_id, @data) end |
#destroy ⇒ Object
59 60 61 |
# File 'lib/actor_sync/adapters/mixpanel.rb', line 59 def destroy @tracker.groups.delete_group(@group_key, @group_id) end |