Sha256: 0f96b2a69c0a0bbb324f7b335d14d6b340d1fd50186be2ce4f2fe7c4b4b175ba
Contents?: true
Size: 945 Bytes
Versions: 11
Compression:
Stored size: 945 Bytes
Contents
require 'pushbullet_ruby/push' module PushbulletRuby module API module Subscriptions def subscriptions PushbulletRuby::Channel.from_response(get('/v2/subscriptions')) end def channel_info(tag) PushbulletRuby::Channel.new(get('/v2/channel-info', tag: tag).body) end def recent_pushes(tag) channel_info(tag).body['recent_pushes'].each_with_object([]) do |push, memo| memo << PushbulletRuby::Push.new(push) end end def update_subscription(channel_id: nil, params: {}) PushbulletRuby::Channel.new(post("/v2/subscriptions/#{channel_id}", params).body) end def delete_subscription(channel_id: nil) delete("/v2/subscriptions/#{channel_id}").body end def create_subscription(params: {}) PushbulletRuby::Channel.new(post('/v2/subscriptions', params)) end end end end
Version data entries
11 entries across 10 versions & 2 rubygems