Class: AfTalk::SendMessageResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/aftalk/responses/send_message_response.rb

Constant Summary

Constants inherited from Response

Response::JSON_CONTENT, Response::SUCCESS_STATUSES

Instance Attribute Summary collapse

Attributes inherited from Response

#body, #error_message, #status

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ SendMessageResponse

Returns a new instance of SendMessageResponse.



5
6
7
8
9
10
11
12
13
# File 'lib/aftalk/responses/send_message_response.rb', line 5

def initialize(response)
  super(response)
  if success?
    @message = body_data[:Message]
    @recipients = body_data[:Recipients].map do |recipient|
      SmsMessageStatus.new(recipient)
    end
  end
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/aftalk/responses/send_message_response.rb', line 3

def message
  @message
end

#recipientsObject (readonly)

Returns the value of attribute recipients.



3
4
5
# File 'lib/aftalk/responses/send_message_response.rb', line 3

def recipients
  @recipients
end