class SubscriptorClient::SubscriptionsClient

Public Class Methods

new(config) click to toggle source
Calls superclass method
# File lib/subscriptor_client/subscriptions_client.rb, line 31
def initialize(config)
  super(
    JsonClient::Pather.new(config[:host], 'api/v1', 'subscriptions'),
    config
  )
end

Public Instance Methods

add_credits(id, params) click to toggle source
# File lib/subscriptor_client/subscriptions_client.rb, line 38
def add_credits(id, params)
  request = requests.add_credits
  path = extended_path('add_credits', id)
  responses.add_credits.new(fetch(path, request, params))
end
remove_credits(id, params) click to toggle source
# File lib/subscriptor_client/subscriptions_client.rb, line 44
def remove_credits(id, params)
  request = requests.add_credits
  path = extended_path('remove_credits', id)
  responses.add_credits.new(fetch(path, request, params))
end

Protected Instance Methods

extended_path(ext, id = nil) click to toggle source
# File lib/subscriptor_client/subscriptions_client.rb, line 52
def extended_path(ext, id = nil)
  "#{pather.path(id)}/#{ext}"
end