Exception: Exacto::Error
- Inherits:
-
Exception
- Object
- Exception
- Exacto::Error
- Defined in:
- lib/exacto_subscriber/error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#messsage ⇒ Object
readonly
Returns the value of attribute messsage.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(code, msg) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(code, msg) ⇒ Error
Returns a new instance of Error.
4 5 6 7 8 |
# File 'lib/exacto_subscriber/error.rb', line 4 def initialize(code, msg) @code = code @message = msg super("Exacto Error: #{code} - #{msg}") end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/exacto_subscriber/error.rb', line 3 def code @code end |
#messsage ⇒ Object (readonly)
Returns the value of attribute messsage.
3 4 5 |
# File 'lib/exacto_subscriber/error.rb', line 3 def messsage @messsage end |
Class Method Details
.from_response(response) ⇒ Object
10 11 12 13 14 |
# File 'lib/exacto_subscriber/error.rb', line 10 def self.from_response(response) if response && code = response["error"] raise new(code, response["error_description"]) end end |