lib/sms_notify/message_status.rb in cdyne-sms-notify-0.7.1 vs lib/sms_notify/message_status.rb in cdyne-sms-notify-0.8.0
- old
+ new
@@ -1,9 +1,10 @@
module SmsNotify
# Represents an SMS message status in the form
# of a Ruby-like object.
class MessageStatus
+ FATAL_ERRORS = ['3', '7', '8', '9', '10', '11', '12', '13', '14']
attr_reader :completed, :demo, :scheduled_time, :status_code, :status_text, :text_id, :received_date, :responded
# Create a new instance of a #MessageStatus
#
# == Example
@@ -22,8 +23,12 @@
@status_code = attrs[:status_code] || nil
@status_text = attrs[:status_text] || nil
@text_id = attrs[:text_id] || nil
@received_date = attrs[:received_date] || nil
@responded = attrs[:responded] || nil
+ end
+
+ def fatal_error?
+ FATAL_ERRORS.include?(self.status_code)
end
end
end