lib/cm_sms/message.rb in cm-sms-0.2.6 vs lib/cm_sms/message.rb in cm-sms-0.2.7
- old
+ new
@@ -2,11 +2,11 @@
require 'phony'
require 'cm_sms/request'
module CmSms
class Message
- class SenderTooLong < ArgumentError; end
+ class FromTooLong < ArgumentError; end
class FromMissing < ArgumentError; end
class ToMissing < ArgumentError; end
class BodyMissing < ArgumentError; end
class BodyTooLong < ArgumentError; end
class ToUnplausible < ArgumentError; end
@@ -67,11 +67,11 @@
request.perform
end
def deliver!
- raise SenderTooLong.new('The value for the sender attribute must contain 1..11 characters.') unless sender_length?
raise FromMissing.new('The value for the from attribute is missing.') unless sender_present?
+ raise FromTooLong.new('The value for the sender attribute must contain 1..11 characters.') unless sender_length?
raise ToMissing.new('The value for the to attribute is missing.') unless receiver_present?
raise BodyMissing.new('The body of the message is missing.') unless body_present?
raise BodyTooLong.new('The body of the message has a length greater than 160.') unless body_correct_length?
raise ToUnplausible.new("The given value for the to attribute is not a plausible phone number.\nMaybe the country code is missing.") unless receiver_plausible?
raise DCSNotNumeric.new("The given value for the dcs attribute is not a number.") unless dcs_numeric?
\ No newline at end of file