Exception: MLBStatsAPI::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- MLBStatsAPI::Error
- Defined in:
- lib/mlb_stats_api/errors.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(response) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ Error
Returns a new instance of Error.
5 6 7 |
# File 'lib/mlb_stats_api/errors.rb', line 5 def initialize(response) @response = response end |
Instance Method Details
#to_s ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/mlb_stats_api/errors.rb', line 9 def to_s format( '%<code>s: %<message>s (%<uri>s)', code: @response.code, message: '', # @response.response, uri: @response.request.last_uri.to_s ) end |