lib/mblox/sms_response.rb in mblox-0.1.0 vs lib/mblox/sms_response.rb in mblox-0.2.0

- old
+ new

@@ -19,11 +19,11 @@ attr_reader :code, :text def initialize(code, text) @code, @text = (code.to_i.to_s == code ? code.to_i : code), text end - def is_ok? + def ok? 0 == @code end def ==(rhs) code == rhs.code && text == rhs.text @@ -48,22 +48,22 @@ result_list = result_list['NotificationResult'] raise MissingExpectedXmlContentError, "Xml should have contained a 'NotificationRequestResult' -> 'NotificationResultList' => 'NotificationResult' node, but was #{xml}" if result_list.blank? @result = Result.new(result_list['NotificationResultCode'], result_list['NotificationResultText']) @result = nil unless @result.valid? - if @result.is_ok? + if @result.ok? result_list = result_list['SubscriberResult'] raise MissingExpectedXmlContentError, "Xml should have contained a 'NotificationRequestResult' -> 'NotificationResultList' => 'NotificationResult' -> 'SubscriberResult' node, but was #{xml}" if result_list.blank? @subscriber_result = Result.new(result_list['SubscriberResultCode'], result_list['SubscriberResultText']) @subscriber_result = nil unless @subscriber_result.valid? end end - def is_ok? - @request.is_ok? && @result.is_ok? && @subscriber_result.is_ok? + def ok? + @request.ok? && @result.ok? && @subscriber_result.ok? end - def is_unroutable? - @request.is_ok? && @result.is_ok? && Result::UNROUTABLE == @subscriber_result + def unroutable? + @request.ok? && @result.ok? && Result::UNROUTABLE == @subscriber_result end end end