Sha256: 0e1de790bc8ffdee566707e44e13df8a5e910be79961ec4648cae9a5fbb67d93

Contents?: true

Size: 429 Bytes

Versions: 1

Compression:

Stored size: 429 Bytes

Contents

require 'washbullet/entity'

module Washbullet
  class Device < Entity
    def self.from_response(response)
      response.body['devices'].each_with_object([]) {|attributes, memo|
        next unless attributes['active']

        memo << new(attributes)
      }
    end

    def identifier
      body['iden']
    end

    def nickname
      body['nickname']
    end

    private

    def receiver
      :device
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
washbullet-0.4.0 lib/washbullet/device.rb