Exception: IdealPostcodes::IdealPostcodesError
- Inherits:
-
StandardError
- Object
- StandardError
- IdealPostcodes::IdealPostcodesError
- Defined in:
- lib/idealpostcodes/errors.rb
Direct Known Subclasses
AuthenticationError, LimitReachedError, ResourceNotFoundError, TokenExhaustedError
Instance Attribute Summary collapse
-
#http_body ⇒ Object
readonly
Returns the value of attribute http_body.
-
#http_code ⇒ Object
readonly
Returns the value of attribute http_code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#response_code ⇒ Object
readonly
Returns the value of attribute response_code.
Instance Method Summary collapse
-
#initialize(message = nil, http_code = nil, http_body = nil, response_code = nil) ⇒ IdealPostcodesError
constructor
A new instance of IdealPostcodesError.
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, http_code = nil, http_body = nil, response_code = nil) ⇒ IdealPostcodesError
Returns a new instance of IdealPostcodesError.
8 9 10 11 12 13 |
# File 'lib/idealpostcodes/errors.rb', line 8 def initialize( = nil, http_code = nil, http_body = nil, response_code = nil) @message = @http_code = http_code @http_body = http_body @response_code = response_code end |
Instance Attribute Details
#http_body ⇒ Object (readonly)
Returns the value of attribute http_body.
5 6 7 |
# File 'lib/idealpostcodes/errors.rb', line 5 def http_body @http_body end |
#http_code ⇒ Object (readonly)
Returns the value of attribute http_code.
4 5 6 |
# File 'lib/idealpostcodes/errors.rb', line 4 def http_code @http_code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/idealpostcodes/errors.rb', line 3 def @message end |
#response_code ⇒ Object (readonly)
Returns the value of attribute response_code.
6 7 8 |
# File 'lib/idealpostcodes/errors.rb', line 6 def response_code @response_code end |
Instance Method Details
#to_s ⇒ Object
15 16 17 18 19 |
# File 'lib/idealpostcodes/errors.rb', line 15 def to_s status = @http_code.nil? ? "" : "#{@http_code} error." ideal_code = @response_code.nil? ? "" : "(#{@response_code})" "#{status} error. (#{ideal_code}) #{}" end |