Class: SynapsePayments::Subscriptions
- Inherits:
-
Object
- Object
- SynapsePayments::Subscriptions
- Defined in:
- lib/synapse_payments/subscriptions.rb
Instance Method Summary collapse
- #all ⇒ Object
- #create(url:, scope:) ⇒ Object
- #find(id) ⇒ Object
-
#initialize(client) ⇒ Subscriptions
constructor
A new instance of Subscriptions.
- #update(id, data) ⇒ Object
Constructor Details
#initialize(client) ⇒ Subscriptions
Returns a new instance of Subscriptions.
4 5 6 |
# File 'lib/synapse_payments/subscriptions.rb', line 4 def initialize(client) @client = client end |
Instance Method Details
#all ⇒ Object
8 9 10 |
# File 'lib/synapse_payments/subscriptions.rb', line 8 def all @client.get(path: '/subscriptions') end |
#create(url:, scope:) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/synapse_payments/subscriptions.rb', line 12 def create(url:, scope:) data = { url: url, scope: scope } @client.post(path: "/subscriptions", json: data) end |
#find(id) ⇒ Object
21 22 23 |
# File 'lib/synapse_payments/subscriptions.rb', line 21 def find(id) @client.get(path: "/subscriptions/#{id}") end |
#update(id, data) ⇒ Object
25 26 27 |
# File 'lib/synapse_payments/subscriptions.rb', line 25 def update(id, data) @client.patch(path: "/subscriptions/#{id}", json: data) end |