lib/sms_notify/message_status.rb in cdyne-sms-notify-0.10.0 vs lib/sms_notify/message_status.rb in cdyne-sms-notify-0.10.1

- old
+ new

@@ -7,25 +7,25 @@ # Create a new instance of a #MessageStatus # # == Example # SmsNotify::MessageStatus.new( - # :Completed => '1', - # :Demo => '0', - # :ScheduledTime => '2010-04-03T14:29:14.7', - # :StatusCode => '6', - # :StatusText => 'Completed', - # :ReceivedDate => '2010-04-03T14:29:14.7', - # :Responded => '0') + # "Completed" => '1', + # "Demo" => '0', + # "ScheduledTime" => '2010-04-03T14:29:14.7', + # "StatusCode" => '6', + # "StatusText" => 'Completed', + # "ReceivedDate" => '2010-04-03T14:29:14.7', + # "Responded" => '0') def initialize(attrs) - @completed = attrs[:completed] || attrs[:Completed] || nil - @demo = attrs[:demo] || nil - @scheduled_time = attrs[:scheduled_time] || attrs[:ScheduledTime] || nil - @status_code = attrs[:status_code] || attrs[:StatusCode] || nil - @status_text = attrs[:status_text] || attrs[:StatusText] || nil - @text_id = attrs[:text_id] || attrs[:TextID] || nil - @received_date = attrs[:received_date] || attrs[:ReceivedDate] || nil - @responded = attrs[:responded] || attrs[:Responded] || nil + @completed = attrs[:completed] || attrs["Completed"] || nil + @demo = attrs[:demo] || attrs["Demo"] || nil + @scheduled_time = attrs[:scheduled_time] || attrs["ScheduledTime"] || nil + @status_code = attrs[:status_code] || attrs["StatusCode"] || nil + @status_text = attrs[:status_text] || attrs["StatusText"] || nil + @text_id = attrs[:text_id] || attrs["TextID"] || nil + @received_date = attrs[:received_date] || attrs["ReceivedDate"] || nil + @responded = attrs[:responded] || attrs["Responded"] || nil end def fatal_error? FATAL_ERRORS.include?(self.status_code) end