class Pushbullet::V2::Devices

Constants

API_URL

Public Class Methods

delete(device_iden) click to toggle source

delete a device

@param device_iden [String] device identifier @return [JSON] result as json

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

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

get devices list

@return [JSON] result as json

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

  JSON.parse(result.body)
end
register(nickname, type) click to toggle source

create a new device

@param nickname [String] nickname of the device @param type [String] type of the device @return [JSON] result as json

# File lib/v2/devices.rb, line 36
def self.register(nickname, type)
  result = Pushbullet::V2::request(API_URL, {
    nickname: nickname,
    type: type,
  })

  JSON.parse(result.body)
end
update(device_iden, values) click to toggle source

update a device

@param device_iden [String] device identifier @param values [Hash] values to update @return [JSON] result as json

# File lib/v2/devices.rb, line 50
def self.update(device_iden, values)
  result = Pushbullet::V2::request(API_URL + '/' + device_iden, values)

  JSON.parse(result.body)
end