Sha256: 33939a944e1d66a2d64377d15a123fbc22d736a6964404e4e19f76b0564bcdc8

Contents?: true

Size: 441 Bytes

Versions: 1

Compression:

Stored size: 441 Bytes

Contents

require 'pushbullet_ruby/api'

module PushbulletRuby
  class Channel
    attr_reader :body

    def self.from_response(response)
      response.body['subscriptions'].each_with_object([]) do |attributes, memo|
        next unless attributes['active']
        memo << new(attributes['channel'])
      end
    end

    def initialize(response)
      @body = response
    end

    def tag
      body['tag']
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pushbullet_ruby-1.0.1 lib/pushbullet_ruby/channel.rb