class Pushbots::Devices

Devices class

Constants

PLATFORM_TYPE

Attributes

platform[RW]
tags[RW]
tokens[RW]

Public Class Methods

new(tokens, platform, tags = nil) click to toggle source
# File lib/pushbots/devices.rb, line 7
def initialize(tokens, platform, tags = nil)
  self.tokens = tokens
  self.platform = platform
  self.tags = tags if tags
end

Public Instance Methods

register() click to toggle source
# File lib/pushbots/devices.rb, line 13
def register
  body = { tokens: tokens, platform: PLATFORM_TYPE[platform] }
  body[:tags] = tags if tags
  response = Request.register_batch(body)
  response.code == 201
end