class Pushbots::All
All
class
Attributes
alias[RW]
badge[RW]
except_alias[RW]
payload[RW]
schedule[RW]
sound[RW]
Public Class Methods
new(platforms, message, schedule, options = {})
click to toggle source
Calls superclass method
# File lib/pushbots/all.rb, line 7 def initialize(platforms, message, schedule, options = {}) super(platforms, message, :all) self.schedule = schedule self.tags = options[:tags] self.sound = options[:sound] self.badge = options[:badge] self.except_tags = options[:except_tags] self.device_alias = options[:alias] self.except_alias = options[:except_alias] self.payload = options[:payload] end
Public Instance Methods
body()
click to toggle source
# File lib/pushbots/all.rb, line 25 def body data = { platform: @platform, msg: message, schedule: schedule } data[:tags] if tags data[:badge] if badge data[:alias] if device_alias data[:except_tags] if except_tags data[:payload] if payload data end
send()
click to toggle source
# File lib/pushbots/all.rb, line 19 def send self.response = Request.send(:all, body) self.status = response.failed? ? STATUS[:failed] : STATUS[:delivered] end