Sha256: b6fb1ab73dc863f03e8397cb1328f5ef00f84cc4f9aa40ce29acb37e5bfb18e5

Contents?: true

Size: 828 Bytes

Versions: 7

Compression:

Stored size: 828 Bytes

Contents

module SmsNotify
  # Represents an SMS message response (text reply) in the form
  # of a Ruby-like object.
  class MessageResponse
    attr_reader :response_id, :text_id, :status_code, :received_date, :message

    # 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')
    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
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cdyne-sms-notify-1.0.6 lib/sms_notify/message_response.rb
cdyne-sms-notify-1.0.4 lib/sms_notify/message_response.rb
cdyne-sms-notify-1.0.3 lib/sms_notify/message_response.rb
cdyne-sms-notify-1.0.2 lib/sms_notify/message_response.rb
cdyne-sms-notify-1.0.1 lib/sms_notify/message_response.rb
cdyne-sms-notify-1.0.0 lib/sms_notify/message_response.rb
cdyne-sms-notify-0.10.1 lib/sms_notify/message_response.rb