Class: Polar::Client

Inherits:
Object
  • Object
show all
Includes:
Pagination
Defined in:
lib/polar/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Pagination

#auto_paginate, #paginate

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



9
10
11
12
13
# File 'lib/polar/client.rb', line 9

def initialize(options = {})
  @configuration = build_configuration(options)
  @auth = build_authentication(options)
  @http_client = HTTPClient.new(@configuration, @auth)
end

Instance Attribute Details

#authObject (readonly)

Returns the value of attribute auth.



7
8
9
# File 'lib/polar/client.rb', line 7

def auth
  @auth
end

#configurationObject (readonly)

Returns the value of attribute configuration.



7
8
9
# File 'lib/polar/client.rb', line 7

def configuration
  @configuration
end

#http_clientObject (readonly)

Returns the value of attribute http_client.



7
8
9
# File 'lib/polar/client.rb', line 7

def http_client
  @http_client
end

Instance Method Details

#benefitsObject



44
45
46
# File 'lib/polar/client.rb', line 44

def benefits
  @benefits ||= Resources::Benefits.new(self)
end

#checkoutsObject



40
41
42
# File 'lib/polar/client.rb', line 40

def checkouts
  @checkouts ||= Resources::Checkouts.new(self)
end

#customer_portalObject

Customer Portal API



73
74
75
# File 'lib/polar/client.rb', line 73

def customer_portal
  @customer_portal ||= CustomerPortalClient.new(self)
end

#customersObject



24
25
26
# File 'lib/polar/client.rb', line 24

def customers
  @customers ||= Resources::Customers.new(self)
end

#eventsObject



60
61
62
# File 'lib/polar/client.rb', line 60

def events
  @events ||= Resources::Events.new(self)
end

#filesObject



52
53
54
# File 'lib/polar/client.rb', line 52

def files
  @files ||= Resources::Files.new(self)
end

#license_keysObject



48
49
50
# File 'lib/polar/client.rb', line 48

def license_keys
  @license_keys ||= Resources::LicenseKeys.new(self)
end

#metricsObject



56
57
58
# File 'lib/polar/client.rb', line 56

def metrics
  @metrics ||= Resources::Metrics.new(self)
end

#oauth2Object



68
69
70
# File 'lib/polar/client.rb', line 68

def oauth2
  @oauth2 ||= Resources::OAuth2.new(self)
end

#ordersObject



28
29
30
# File 'lib/polar/client.rb', line 28

def orders
  @orders ||= Resources::Orders.new(self)
end

#organizationsObject

Core API Resources



16
17
18
# File 'lib/polar/client.rb', line 16

def organizations
  @organizations ||= Resources::Organizations.new(self)
end

#paymentsObject



32
33
34
# File 'lib/polar/client.rb', line 32

def payments
  @payments ||= Resources::Payments.new(self)
end

#productsObject



20
21
22
# File 'lib/polar/client.rb', line 20

def products
  @products ||= Resources::Products.new(self)
end

#subscriptionsObject



36
37
38
# File 'lib/polar/client.rb', line 36

def subscriptions
  @subscriptions ||= Resources::Subscriptions.new(self)
end

#webhooksObject



64
65
66
# File 'lib/polar/client.rb', line 64

def webhooks
  @webhooks ||= Resources::Webhooks.new(self)
end