Class: Mblox::SmsResponse::Result
- Inherits:
-
Object
- Object
- Mblox::SmsResponse::Result
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/mblox/sms_response.rb
Constant Summary collapse
- UNROUTABLE_TEXT =
"MsipRejectCode=29 Number unroutable:2e Do not retry:2e"- UNROUTABLE =
new(10, UNROUTABLE_TEXT)
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #==(rhs) ⇒ Object
-
#initialize(code, text) ⇒ Result
constructor
A new instance of Result.
- #ok? ⇒ Boolean
Constructor Details
#initialize(code, text) ⇒ Result
Returns a new instance of Result.
20 21 22 |
# File 'lib/mblox/sms_response.rb', line 20 def initialize(code, text) @code, @text = (code.to_i.to_s == code ? code.to_i : code), text end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
19 20 21 |
# File 'lib/mblox/sms_response.rb', line 19 def code @code end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
19 20 21 |
# File 'lib/mblox/sms_response.rb', line 19 def text @text end |
Instance Method Details
#==(rhs) ⇒ Object
28 29 30 |
# File 'lib/mblox/sms_response.rb', line 28 def ==(rhs) code == rhs.code && text == rhs.text end |
#ok? ⇒ Boolean
24 25 26 |
# File 'lib/mblox/sms_response.rb', line 24 def ok? 0 == @code end |