Class: Strava::Webhooks::Client
- Inherits:
-
Strava::Web::Client
- Object
- Strava::Web::Client
- Strava::Webhooks::Client
- Defined in:
- lib/strava/webhooks/client.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#create_push_subscription(options = {}) ⇒ Object
Create a subscription.
-
#delete_push_subscription(id_or_options, options = {}) ⇒ Object
Delete an existing push subscription.
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
-
#push_subscriptions(options = {}) ⇒ Object
Get existing push subscriptions.
- #request(method, path, options) ⇒ Object
Methods inherited from Strava::Web::Client
Methods included from Strava::Web::Request
Constructor Details
Class Method Details
.config ⇒ Object
52 53 54 |
# File 'lib/strava/webhooks/client.rb', line 52 def config Config end |
Instance Method Details
#create_push_subscription(options = {}) ⇒ Object
Create a subscription.
43 44 45 |
# File 'lib/strava/webhooks/client.rb', line 43 def create_push_subscription( = {}) Strava::Webhooks::Models::Subscription.new(post('push_subscriptions', )) end |
#delete_push_subscription(id_or_options, options = {}) ⇒ Object
Delete an existing push subscription.
29 30 31 32 33 |
# File 'lib/strava/webhooks/client.rb', line 29 def delete_push_subscription(, = {}) id, = parse_args(, ) delete("push_subscriptions/#{id}", ) nil end |
#push_subscriptions(options = {}) ⇒ Object
Get existing push subscriptions.
20 21 22 23 24 |
# File 'lib/strava/webhooks/client.rb', line 20 def push_subscriptions( = {}) get('push_subscriptions', ).map do |row| Strava::Webhooks::Models::Subscription.new(row) end end |
#request(method, path, options) ⇒ Object
13 14 15 |
# File 'lib/strava/webhooks/client.rb', line 13 def request(method, path, ) super method, path, { client_id: client_id, client_secret: client_secret }.merge() end |