Class: PushbulletRuby::Push

Inherits:
Entity
  • Object
show all
Defined in:
lib/pushbullet_ruby/push.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/push.rb', line 5

def self.from_response(response)
  response.body['pushes'].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/push.rb', line 12

def id
  body['iden']
end

#typeObject



16
17
18
# File 'lib/pushbullet_ruby/push.rb', line 16

def type
  body['type']
end