Class: Pushbullet::V2::Subscriptions
- Inherits:
-
Object
- Object
- Pushbullet::V2::Subscriptions
- Defined in:
- lib/v2/subscriptions.rb
Constant Summary collapse
- API_URL =
'https://api.pushbullet.com/v2/subscriptions'
Class Method Summary collapse
-
.channel_info(channel_tag) ⇒ JSON
get information on given channel.
-
.get ⇒ JSON
get subscriptions list.
-
.subscribe(channel_tag) ⇒ JSON
subscribe a new subscription.
-
.unsubscribe(subscription_iden) ⇒ JSON
unsubscribe a subscription.
Class Method Details
.channel_info(channel_tag) ⇒ JSON
get information on given channel
57 58 59 60 61 62 63 |
# File 'lib/v2/subscriptions.rb', line 57 def self.channel_info(channel_tag) result = Pushbullet::V2::request_get('https://api.pushbullet.com/v2/channel-info', { tag: channel_tag, }) JSON.parse(result.body) end |
.get ⇒ JSON
get subscriptions list
25 26 27 28 29 |
# File 'lib/v2/subscriptions.rb', line 25 def self.get result = Pushbullet::V2::request_get(API_URL, {}) JSON.parse(result.body) end |
.subscribe(channel_tag) ⇒ JSON
subscribe a new subscription
35 36 37 38 39 40 41 |
# File 'lib/v2/subscriptions.rb', line 35 def self.subscribe(channel_tag) result = Pushbullet::V2::request(API_URL, { channel_tag: channel_tag, }) JSON.parse(result.body) end |
.unsubscribe(subscription_iden) ⇒ JSON
unsubscribe a subscription
47 48 49 50 51 |
# File 'lib/v2/subscriptions.rb', line 47 def self.unsubscribe(subscription_iden) result = Pushbullet::V2::request_delete(API_URL + '/' + subscription_iden, {}) JSON.parse(result.body) end |