Class: SmsNotify::MessageResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/sms_notify/message_response.rb

Overview

Represents an SMS message response (text reply) in the form of a Ruby-like object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ MessageResponse

Create a new instance of a #MessageResponse

Example

SmsNotify::MessageResponse.new(
  "ResponseID"    => '1',
  "TextID"        => '123',
  "StatusCode"    => '6',
  "ReceivedDate"  => '2010-04-03T14:29:14.7',
  "Message"       => 'foo')


16
17
18
19
20
21
22
# File 'lib/sms_notify/message_response.rb', line 16

def initialize(attrs)
  @response_id    = attrs["ResponseID"]   || nil
  @text_id        = attrs["TextID"]       || nil
  @status_code    = attrs["StatusCode"]   || nil
  @received_date  = attrs["ReceivedDate"] || nil
  @message        = attrs["Message"]      || nil
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/sms_notify/message_response.rb', line 5

def message
  @message
end

#received_dateObject (readonly)

Returns the value of attribute received_date.



5
6
7
# File 'lib/sms_notify/message_response.rb', line 5

def received_date
  @received_date
end

#response_idObject (readonly)

Returns the value of attribute response_id.



5
6
7
# File 'lib/sms_notify/message_response.rb', line 5

def response_id
  @response_id
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



5
6
7
# File 'lib/sms_notify/message_response.rb', line 5

def status_code
  @status_code
end

#text_idObject (readonly)

Returns the value of attribute text_id.



5
6
7
# File 'lib/sms_notify/message_response.rb', line 5

def text_id
  @text_id
end