Class: Appboy::REST::TriggerCanvas
- Defined in:
- lib/appboy/rest/trigger_canvas.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#audience ⇒ Object
readonly
Returns the value of attribute audience.
-
#broadcast ⇒ Object
readonly
Returns the value of attribute broadcast.
-
#canvas_entry_properties ⇒ Object
readonly
Returns the value of attribute canvas_entry_properties.
-
#canvas_id ⇒ Object
readonly
Returns the value of attribute canvas_id.
-
#recipients ⇒ Object
readonly
Returns the value of attribute recipients.
Instance Method Summary collapse
-
#initialize(app_group_id, options = {}) ⇒ TriggerCanvas
constructor
A new instance of TriggerCanvas.
- #perform ⇒ Object
Constructor Details
#initialize(app_group_id, options = {}) ⇒ TriggerCanvas
Returns a new instance of TriggerCanvas.
7 8 9 10 11 12 13 14 |
# File 'lib/appboy/rest/trigger_canvas.rb', line 7 def initialize(app_group_id, = {}) @api_key = app_group_id @audience = [:audience] @broadcast = [:broadcast] || false @canvas_entry_properties = [:canvas_entry_properties] @canvas_id = [:canvas_id] @recipients = [:recipients] end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
4 5 6 |
# File 'lib/appboy/rest/trigger_canvas.rb', line 4 def api_key @api_key end |
#audience ⇒ Object (readonly)
Returns the value of attribute audience.
4 5 6 |
# File 'lib/appboy/rest/trigger_canvas.rb', line 4 def audience @audience end |
#broadcast ⇒ Object (readonly)
Returns the value of attribute broadcast.
4 5 6 |
# File 'lib/appboy/rest/trigger_canvas.rb', line 4 def broadcast @broadcast end |
#canvas_entry_properties ⇒ Object (readonly)
Returns the value of attribute canvas_entry_properties.
4 5 6 |
# File 'lib/appboy/rest/trigger_canvas.rb', line 4 def canvas_entry_properties @canvas_entry_properties end |
#canvas_id ⇒ Object (readonly)
Returns the value of attribute canvas_id.
4 5 6 |
# File 'lib/appboy/rest/trigger_canvas.rb', line 4 def canvas_id @canvas_id end |
#recipients ⇒ Object (readonly)
Returns the value of attribute recipients.
4 5 6 |
# File 'lib/appboy/rest/trigger_canvas.rb', line 4 def recipients @recipients end |
Instance Method Details
#perform ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/appboy/rest/trigger_canvas.rb', line 16 def perform http.post '/canvas/trigger/send', { api_key: api_key, audience: audience, broadcast: broadcast, canvas_entry_properties: canvas_entry_properties, canvas_id: canvas_id, recipients: recipients }.compact end |