Class: AfTalk::FetchMessagesResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/aftalk/responses/fetch_messages_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) ⇒ FetchMessagesResponse

Returns a new instance of FetchMessagesResponse.



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

def initialize(response)
  super(response)
  if success?
    @messages = body_data[:Messages].map do |message_data|
      AfTalk::SmsMessageInfo.new(message_data)
    end
  end
end

Instance Attribute Details

#messagesObject (readonly)

Returns the value of attribute messages.



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

def messages
  @messages
end