Class: PushbulletRuby::Contact

Inherits:
User show all
Defined in:
lib/pushbullet_ruby/contact.rb

Instance Attribute Summary

Attributes inherited from Entity

#body

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from User

#id

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/contact.rb', line 5

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

Instance Method Details

#emailObject



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

def email
  body['email']
end

#nameObject



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

def name
  body['name']
end