Exception: Zerobounce::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Zerobounce::Error
- Defined in:
- lib/zerobounce/error.rb
Overview
The base Zerobounce error.
Direct Known Subclasses
Class Method Summary collapse
-
.from_response(env) ⇒ Error
Parse the response for errors.
Instance Method Summary collapse
-
#initialize(env = {}) ⇒ Error
constructor
A new instance of Error.
-
#message ⇒ String
Message for the error.
Constructor Details
#initialize(env = {}) ⇒ Error
Returns a new instance of Error.
10 11 12 |
# File 'lib/zerobounce/error.rb', line 10 def initialize(env={}) @env = env end |
Class Method Details
.from_response(env) ⇒ Error
Parse the response for errors.
26 27 28 29 30 31 32 33 |
# File 'lib/zerobounce/error.rb', line 26 def from_response(env) case env[:status] when 500 parse_500(env) when 200 parse_200(env) end end |
Instance Method Details
#message ⇒ String
Message for the error.
17 18 19 |
# File 'lib/zerobounce/error.rb', line 17 def @env[:body] end |