Class: PushBuilder::Payload
- Inherits:
-
Object
- Object
- PushBuilder::Payload
- Defined in:
- lib/push_builder/payload.rb
Instance Attribute Summary collapse
-
#aps ⇒ Object
Returns the value of attribute aps.
-
#custom_data ⇒ Object
Returns the value of attribute custom_data.
-
#third_party_data ⇒ Object
Returns the value of attribute third_party_data.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Payload
constructor
A new instance of Payload.
- #to_json ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Payload
5 6 7 8 9 |
# File 'lib/push_builder/payload.rb', line 5 def initialize(args={}) @aps = APS.new @custom_data = {} @third_party_data = {} end |
Instance Attribute Details
#aps ⇒ Object
Returns the value of attribute aps.
3 4 5 |
# File 'lib/push_builder/payload.rb', line 3 def aps @aps end |
#custom_data ⇒ Object
Returns the value of attribute custom_data.
3 4 5 |
# File 'lib/push_builder/payload.rb', line 3 def custom_data @custom_data end |
#third_party_data ⇒ Object
Returns the value of attribute third_party_data.
3 4 5 |
# File 'lib/push_builder/payload.rb', line 3 def third_party_data @third_party_data end |
Instance Method Details
#to_json ⇒ Object
35 36 37 38 |
# File 'lib/push_builder/payload.rb', line 35 def to_json payload = custom_data.merge(aps: aps.to_hash) Compiler.new(payload, third_party_data).compile end |