Class: Appboy::REST::TriggerCampaign
- Defined in:
- lib/appboy/rest/trigger_campaign.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.
-
#campaign_id ⇒ Object
readonly
Returns the value of attribute campaign_id.
-
#recipients ⇒ Object
readonly
Returns the value of attribute recipients.
-
#send_id ⇒ Object
readonly
Returns the value of attribute send_id.
-
#trigger_properties ⇒ Object
readonly
Returns the value of attribute trigger_properties.
Instance Method Summary collapse
-
#initialize(api_key, options = {}) ⇒ TriggerCampaign
constructor
A new instance of TriggerCampaign.
- #perform ⇒ Object
Constructor Details
#initialize(api_key, options = {}) ⇒ TriggerCampaign
Returns a new instance of TriggerCampaign.
7 8 9 10 11 12 13 14 15 |
# File 'lib/appboy/rest/trigger_campaign.rb', line 7 def initialize(api_key, = {}) @api_key = api_key @audience = [:audience] @broadcast = [:broadcast] || false @campaign_id = [:campaign_id] @recipients = [:recipients] @send_id = [:send_id] @trigger_properties = [:trigger_properties] end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
4 5 6 |
# File 'lib/appboy/rest/trigger_campaign.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_campaign.rb', line 4 def audience @audience end |
#broadcast ⇒ Object (readonly)
Returns the value of attribute broadcast.
4 5 6 |
# File 'lib/appboy/rest/trigger_campaign.rb', line 4 def broadcast @broadcast end |
#campaign_id ⇒ Object (readonly)
Returns the value of attribute campaign_id.
4 5 6 |
# File 'lib/appboy/rest/trigger_campaign.rb', line 4 def campaign_id @campaign_id end |
#recipients ⇒ Object (readonly)
Returns the value of attribute recipients.
4 5 6 |
# File 'lib/appboy/rest/trigger_campaign.rb', line 4 def recipients @recipients end |
#send_id ⇒ Object (readonly)
Returns the value of attribute send_id.
4 5 6 |
# File 'lib/appboy/rest/trigger_campaign.rb', line 4 def send_id @send_id end |
#trigger_properties ⇒ Object (readonly)
Returns the value of attribute trigger_properties.
4 5 6 |
# File 'lib/appboy/rest/trigger_campaign.rb', line 4 def trigger_properties @trigger_properties end |
Instance Method Details
#perform ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/appboy/rest/trigger_campaign.rb', line 17 def perform http.post '/campaigns/trigger/send', { api_key: api_key, audience: audience, broadcast: broadcast, campaign_id: campaign_id, recipients: recipients, send_id: send_id, trigger_properties: trigger_properties }.compact end |