Class: Tarpon::Request::Subscriber::Subscription

Inherits:
Base
  • Object
show all
Defined in:
lib/tarpon/request/subscriber/subscription.rb

Constant Summary

Constants inherited from Base

Base::DEFAULT_HEADERS

Instance Method Summary collapse

Constructor Details

#initialize(subscriber_path:, product_id:, **opts) ⇒ Subscription

Returns a new instance of Subscription.



7
8
9
10
11
# File 'lib/tarpon/request/subscriber/subscription.rb', line 7

def initialize(subscriber_path:, product_id:, **opts)
  super(**opts)
  @subscriber_path = subscriber_path
  @product_id = product_id
end

Instance Method Details

#defer(expiry_time_ms:) ⇒ Object



13
14
15
16
17
# File 'lib/tarpon/request/subscriber/subscription.rb', line 13

def defer(expiry_time_ms:)
  body = { expiry_time_ms: expiry_time_ms }

  perform(method: :post, path: "#{path}/defer", key: :secret, body: body)
end