Sha256: 252c85758cd29c6e22a7170ad6dbfc17e53ef920dcbf142e8cf5291544bc5dcc

Contents?: true

Size: 341 Bytes

Versions: 3

Compression:

Stored size: 341 Bytes

Contents

require 'pushbullet_ruby/entity'

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

    def id
      body['iden']
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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