Sha256: b2dc3e71b0ee2ecc41fe4bb19c40787ee98910f358358b4c840e0c53095415d3

Contents?: true

Size: 394 Bytes

Versions: 2

Compression:

Stored size: 394 Bytes

Contents

require 'pushbullet_ruby/entity'

module PushbulletRuby
  class Device < Entity
    def self.from_responce(response)
      response.body['devices'].each_with_object([]) do |attributes, memo|
        next unless attributes['active']
        memo << new(attributes)
      end
    end

    def id
      body['iden']
    end

    def name
      body['nickname']
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pushbullet_ruby-1.0.2 lib/pushbullet_ruby/device.rb
pushbullet_ruby-1.0.1 lib/pushbullet_ruby/device.rb