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 8 9 |
# File 'lib/mlb_stats_api/errors.rb', line 5 def initialize(response) super() @response = response end |
Instance Method Details
#to_s ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/mlb_stats_api/errors.rb', line 11 def to_s # @response.response format( '%<code>s: %<message>s (%<uri>s)', code: @response.code, message: '', uri: @response.request.last_uri.to_s ) end |