Sha256: c3cf42f5597c08483c0cf0781c67f305c22513fe425682dc0be5578fe6c23049

Contents?: true

Size: 453 Bytes

Versions: 3

Compression:

Stored size: 453 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

    def app_version
      body['app_version']
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pushbullet_ruby-1.1.0 lib/pushbullet_ruby/device.rb
pushbullet_ruby-1.0.4.1 lib/pushbullet_ruby/device.rb
pushbullet_ruby-1.0.4 lib/pushbullet_ruby/device.rb