class Tarpon::Request::Subscriber::Entitlement

Public Class Methods

new(subscriber_path:, entitlement_identifier:) click to toggle source
# File lib/tarpon/request/subscriber/entitlement.rb, line 7
def initialize(subscriber_path:, entitlement_identifier:)
  @subscriber_path = subscriber_path
  @entitlement_identifier = entitlement_identifier
end

Public Instance Methods

grant_promotional(duration:, start_time_ms: nil) click to toggle source
# File lib/tarpon/request/subscriber/entitlement.rb, line 12
def grant_promotional(duration:, start_time_ms: nil)
  body = {
    duration: duration,
    start_time_ms: start_time_ms
  }

  perform(method: :post, path: "#{path}/promotional", key: :secret, body: body)
end
revoke_promotional() click to toggle source
# File lib/tarpon/request/subscriber/entitlement.rb, line 21
def revoke_promotional
  perform(method: :post, path: "#{path}/revoke_promotionals", key: :secret)
end

Private Instance Methods

path() click to toggle source
# File lib/tarpon/request/subscriber/entitlement.rb, line 27
def path
  "#{@subscriber_path}/entitlements/#{@entitlement_identifier}"
end