Class: Pushbots::One
Overview
Push class
Constant Summary
Constants inherited from Push
Push::PLATFORM_TYPE, Push::PLATFORM_TYPE_R, Push::STATUS
Instance Attribute Summary collapse
-
#badge ⇒ Object
Returns the value of attribute badge.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#sound ⇒ Object
Returns the value of attribute sound.
-
#token ⇒ Object
Returns the value of attribute token.
Attributes inherited from Push
#message, #platform, #response, #status, #type
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(platform, token, message, sound, options = {}) ⇒ One
constructor
A new instance of One.
- #send ⇒ Object
Constructor Details
#initialize(platform, token, message, sound, options = {}) ⇒ One
Returns a new instance of One.
6 7 8 9 10 11 12 |
# File 'lib/pushbots/one.rb', line 6 def initialize(platform, token, , sound, = {}) super(platform, , :one) self.token = token self.sound = sound self.badge = [:badge] self.payload = [:payload] end |
Instance Attribute Details
#badge ⇒ Object
Returns the value of attribute badge.
4 5 6 |
# File 'lib/pushbots/one.rb', line 4 def badge @badge end |
#payload ⇒ Object
Returns the value of attribute payload.
4 5 6 |
# File 'lib/pushbots/one.rb', line 4 def payload @payload end |
#sound ⇒ Object
Returns the value of attribute sound.
4 5 6 |
# File 'lib/pushbots/one.rb', line 4 def sound @sound end |
#token ⇒ Object
Returns the value of attribute token.
4 5 6 |
# File 'lib/pushbots/one.rb', line 4 def token @token end |
Instance Method Details
#body ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/pushbots/one.rb', line 21 def body data = { platform: @platform, token: token, msg: , sound: sound } data[:badge] if badge data[:payload] if payload data end |