Class: ActionPush::Provider::Base
- Inherits:
-
Object
- Object
- ActionPush::Provider::Base
- Defined in:
- lib/action_push/provider/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#delivered ⇒ Object
- Boolean
-
true
if push was successfully sent to the delivery gate.
-
#delivery_method ⇒ Object
- Proc
-
object which is responds to #call.
-
#delivery_response ⇒ Object
- any
-
response from the delivery gate.
-
#payload ⇒ Object
extra data (JSON) to sent with a PUSH message as a payload.
-
#scheduled ⇒ Object
- Boolean
-
If the PUSH message scheduled to deliver.
-
#token ⇒ Object
- String
-
Device token.
Instance Method Summary collapse
- #assign(params = {}) ⇒ Self
- #body ⇒ Object
- #body=(_value) ⇒ Object
- #deliver ⇒ Object
-
#initialize(params = {}) {|_self| ... } ⇒ Base
constructor
A new instance of Base.
- #title ⇒ Object
- #title=(_value) ⇒ Object
Constructor Details
#initialize(params = {}) {|_self| ... } ⇒ Base
Returns a new instance of Base.
30 31 32 33 34 |
# File 'lib/action_push/provider/base.rb', line 30 def initialize(params = {}) assign(params) yield(self) if block_given? end |
Instance Attribute Details
#delivered ⇒ Object
- Boolean
-
true
if push was successfully sent to the delivery gate
28 29 30 |
# File 'lib/action_push/provider/base.rb', line 28 def delivered @delivered end |
#delivery_method ⇒ Object
- Proc
-
object which is responds to #call
20 21 22 |
# File 'lib/action_push/provider/base.rb', line 20 def delivery_method @delivery_method end |
#delivery_response ⇒ Object
- any
-
response from the delivery gate
24 25 26 |
# File 'lib/action_push/provider/base.rb', line 24 def delivery_response @delivery_response end |
#payload ⇒ Object
extra data (JSON) to sent with a PUSH message as a payload
16 17 18 |
# File 'lib/action_push/provider/base.rb', line 16 def payload @payload end |
#scheduled ⇒ Object
- Boolean
-
If the PUSH message scheduled to deliver
8 9 10 |
# File 'lib/action_push/provider/base.rb', line 8 def scheduled @scheduled end |
#token ⇒ Object
- String
-
Device token
12 13 14 |
# File 'lib/action_push/provider/base.rb', line 12 def token @token end |
Instance Method Details
#assign(params = {}) ⇒ Self
37 38 39 40 41 |
# File 'lib/action_push/provider/base.rb', line 37 def assign(params = {}) params.each { |key, value| public_send("#{key}=", value) } self end |
#body ⇒ Object
55 56 57 |
# File 'lib/action_push/provider/base.rb', line 55 def body raise NotImplementedError, __method__ end |
#body=(_value) ⇒ Object
47 48 49 |
# File 'lib/action_push/provider/base.rb', line 47 def body=(_value) raise NotImplementedError, __method__ end |
#deliver ⇒ Object
59 60 61 |
# File 'lib/action_push/provider/base.rb', line 59 def deliver delivery_method.call(self) end |
#title ⇒ Object
51 52 53 |
# File 'lib/action_push/provider/base.rb', line 51 def title raise NotImplementedError, __method__ end |
#title=(_value) ⇒ Object
43 44 45 |
# File 'lib/action_push/provider/base.rb', line 43 def title=(_value) raise NotImplementedError, __method__ end |