class PushBot::Push

Public Instance Methods

notify(message, push_options={}) click to toggle source

Push a new message to the Segment

@param message The message to alert the user with @param push_options Any of the options available {pushbots.com/developer/rest Rest Docs @ PushBots} @return {PushBot::Response}

# File lib/push_bot/push.rb, line 8
def notify(message, push_options={})
  options = { :sound => '' }
  options, type = options.merge(push_options).merge(
    :msg => message,
    :platform => platforms
  ), :all

  unless batch?
    type = :one
    options[:badge] ||= '0'
    options[:token] = token
    options[:platform] = platform
  end

  Request.new(:push).post(type, options)
end