Class: PushBuilder::Compiler
- Inherits:
-
Object
- Object
- PushBuilder::Compiler
- Defined in:
- lib/push_builder/compiler.rb
Constant Summary collapse
- MAX_PAYLOAD_SIZE =
256
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#third_party_data ⇒ Object
readonly
Returns the value of attribute third_party_data.
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(payload, third_party_data = {}) ⇒ Compiler
constructor
A new instance of Compiler.
Constructor Details
#initialize(payload, third_party_data = {}) ⇒ Compiler
Returns a new instance of Compiler.
9 10 11 12 |
# File 'lib/push_builder/compiler.rb', line 9 def initialize(payload, third_party_data={}) @payload = payload @third_party_data = third_party_data end |
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
7 8 9 |
# File 'lib/push_builder/compiler.rb', line 7 def payload @payload end |
#third_party_data ⇒ Object (readonly)
Returns the value of attribute third_party_data.
7 8 9 |
# File 'lib/push_builder/compiler.rb', line 7 def third_party_data @third_party_data end |
Instance Method Details
#compile ⇒ Object
14 15 16 17 18 |
# File 'lib/push_builder/compiler.rb', line 14 def compile crop_alert_if_necessary! to_json(third_party_data.merge(payload)) end |