class Pushbullet::V2::Contacts

Constants

API_URL

Public Class Methods

create(name, email) click to toggle source

create a new contact

@param name [String] nickname of the contact @param email [String] email of the contact @return [JSON] result as json

# File lib/v2/contacts.rb, line 36
def self.create(name, email)
  result = Pushbullet::V2::request(API_URL, {
    name: name,
    email: email,
  })

  JSON.parse(result.body)
end
delete(contact_iden) click to toggle source

delete a contact

@param contact_iden [String] contact identifier @return [JSON] result as json

# File lib/v2/contacts.rb, line 62
def self.delete(contact_iden)
  result = Pushbullet::V2::request_delete(API_URL + '/' + contact_iden, {})

  JSON.parse(result.body)
end
get() click to toggle source

get contacts list

@return [JSON] result as json

# File lib/v2/contacts.rb, line 25
def self.get
  result = Pushbullet::V2::request_get(API_URL, {})

  JSON.parse(result.body)
end
update(contact_iden, name) click to toggle source

update a contact

@param contact_iden [String] contact identifier @param name [String] name of the contact @return [JSON] result as json

# File lib/v2/contacts.rb, line 50
def self.update(contact_iden, name)
  result = Pushbullet::V2::request(API_URL + '/' + contact_iden, {
    name: name,
  })

  JSON.parse(result.body)
end