Class: Otter::Error
- Inherits:
-
Object
- Object
- Otter::Error
- Defined in:
- lib/otter/error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
Constructor Details
#initialize(code) ⇒ Error
Returns a new instance of Error.
6 7 8 |
# File 'lib/otter/error.rb', line 6 def initialize(code) @code = code.to_i end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/otter/error.rb', line 4 def code @code end |
Instance Method Details
#message ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/otter/error.rb', line 10 def case self.code when 400 then 'Parameter Check Failed' when 403 then 'Forbidden' when 404 then 'Action Not Supported' when 500 then 'Unexpected Internal Error' when 503 then 'Temporarily Unavailable' else 'Unkown' end end |