Class: Polar::Resources::Subscriptions
- Defined in:
- lib/polar/resources/subscriptions.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#export(params = {}) ⇒ Hash
Export subscriptions.
-
#get(id) ⇒ Hash
Get a subscription by ID.
-
#list(params = {}) ⇒ PaginatedResponse
List subscriptions.
-
#revoke(id) ⇒ Hash
Revoke (cancel) a subscription.
-
#update(id, attributes) ⇒ Hash
Update a subscription.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Polar::Resources::Base
Instance Method Details
#export(params = {}) ⇒ Hash
Export subscriptions
24 25 26 27 |
# File 'lib/polar/resources/subscriptions.rb', line 24 def export(params = {}) response = post('/subscriptions/export', params) response.body end |
#get(id) ⇒ Hash
Get a subscription by ID
32 33 34 35 |
# File 'lib/polar/resources/subscriptions.rb', line 32 def get(id) response = get("/subscriptions/#{id}") response.body end |
#list(params = {}) ⇒ PaginatedResponse
List subscriptions
17 18 19 |
# File 'lib/polar/resources/subscriptions.rb', line 17 def list(params = {}) paginate('/subscriptions/', params) end |
#revoke(id) ⇒ Hash
Revoke (cancel) a subscription
49 50 51 52 |
# File 'lib/polar/resources/subscriptions.rb', line 49 def revoke(id) response = post("/subscriptions/#{id}/revoke") response.body end |
#update(id, attributes) ⇒ Hash
Update a subscription
41 42 43 44 |
# File 'lib/polar/resources/subscriptions.rb', line 41 def update(id, attributes) response = patch("/subscriptions/#{id}", attributes) response.body end |