Module: Caffeinate::Dripper::Subscriber::ClassMethods
- Defined in:
- lib/caffeinate/dripper/subscriber.rb
Instance Method Summary collapse
-
#subscribe(subscriber, **args) ⇒ Caffeinate::CampaignSubscriber
Subscribes to the campaign.
-
#subscriptions ⇒ Object
Returns the Campaign’s ‘Caffeinate::CampaignSubscriber`.
-
#unsubscribe(subscriber, **args) ⇒ Caffeinate::CampaignSubscriber
Unsubscribes from the campaign.
-
#unsubscribe!(subscriber, **args) ⇒ Caffeinate::CampaignSubscriber
Unsubscribes from the campaign.
Instance Method Details
#subscribe(subscriber, **args) ⇒ Caffeinate::CampaignSubscriber
Subscribes to the campaign.
OrderDripper.subscribe(order, user: order.user)
26 27 28 |
# File 'lib/caffeinate/dripper/subscriber.rb', line 26 def subscribe(subscriber, **args) caffeinate_campaign.subscribe!(subscriber, **args) end |
#subscriptions ⇒ Object
Returns the Campaign’s ‘Caffeinate::CampaignSubscriber`
14 15 16 |
# File 'lib/caffeinate/dripper/subscriber.rb', line 14 def subscriptions caffeinate_campaign.caffeinate_campaign_subscriptions end |
#unsubscribe(subscriber, **args) ⇒ Caffeinate::CampaignSubscriber
Unsubscribes from the campaign. Returns false if something’s wrong.
OrderDripper.unsubscribe(order, user: order.user)
38 39 40 |
# File 'lib/caffeinate/dripper/subscriber.rb', line 38 def unsubscribe(subscriber, **args) caffeinate_campaign.unsubscribe(subscriber, **args) end |
#unsubscribe!(subscriber, **args) ⇒ Caffeinate::CampaignSubscriber
Unsubscribes from the campaign. Raises error if somerthing’s wrong.
OrderDripper.unsubscribe(order, user: order.user)
50 51 52 |
# File 'lib/caffeinate/dripper/subscriber.rb', line 50 def unsubscribe!(subscriber, **args) caffeinate_campaign.unsubscribe!(subscriber, **args) end |