Class: PushbulletRuby::Chat

Inherits:
Entity
  • Object
show all
Defined in:
lib/pushbullet_ruby/chat.rb

Instance Attribute Summary

Attributes inherited from Entity

#body

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#created, #initialize, #modified

Constructor Details

This class inherits a constructor from PushbulletRuby::Entity

Class Method Details

.from_response(response) ⇒ Object



5
6
7
8
9
10
# File 'lib/pushbullet_ruby/chat.rb', line 5

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

Instance Method Details

#idObject



12
13
14
# File 'lib/pushbullet_ruby/chat.rb', line 12

def id
  body['iden']
end