Class: Appboy::REST::SendMessages
- Defined in:
- lib/appboy/rest/send_messages.rb
Instance Attribute Summary collapse
-
#app_group_id ⇒ Object
readonly
Returns the value of attribute app_group_id.
-
#external_user_ids ⇒ Object
readonly
Returns the value of attribute external_user_ids.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#segment_id ⇒ Object
readonly
Returns the value of attribute segment_id.
Instance Method Summary collapse
-
#initialize(app_group_id, messages: [], external_user_ids: [], segment_id: nil) ⇒ SendMessages
constructor
A new instance of SendMessages.
- #perform ⇒ Object
Constructor Details
#initialize(app_group_id, messages: [], external_user_ids: [], segment_id: nil) ⇒ SendMessages
Returns a new instance of SendMessages.
6 7 8 9 10 11 |
# File 'lib/appboy/rest/send_messages.rb', line 6 def initialize(app_group_id, messages: [], external_user_ids: [], segment_id: nil) @app_group_id = app_group_id @messages = @external_user_ids = external_user_ids @segment_id = segment_id end |
Instance Attribute Details
#app_group_id ⇒ Object (readonly)
Returns the value of attribute app_group_id.
4 5 6 |
# File 'lib/appboy/rest/send_messages.rb', line 4 def app_group_id @app_group_id end |
#external_user_ids ⇒ Object (readonly)
Returns the value of attribute external_user_ids.
4 5 6 |
# File 'lib/appboy/rest/send_messages.rb', line 4 def external_user_ids @external_user_ids end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
4 5 6 |
# File 'lib/appboy/rest/send_messages.rb', line 4 def @messages end |
#segment_id ⇒ Object (readonly)
Returns the value of attribute segment_id.
4 5 6 |
# File 'lib/appboy/rest/send_messages.rb', line 4 def segment_id @segment_id end |
Instance Method Details
#perform ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/appboy/rest/send_messages.rb', line 13 def perform http.post '/messages/send', { app_group_id: app_group_id, messages: , external_user_ids: external_user_ids, segment_ids: [segment_id].compact } end |