Class: HeroixApi::Processor
- Inherits:
-
Object
- Object
- HeroixApi::Processor
- Defined in:
- lib/heroix_api/processor.rb
Class Method Summary collapse
-
.get_api_response(query) ⇒ Object
Get an api response catching errors and logging them.
-
.get_api_response!(query) ⇒ Object
Get an api response allowing errors to be raised.
Class Method Details
.get_api_response(query) ⇒ Object
Get an api response catching errors and logging them.
9 10 11 12 13 14 15 16 17 |
# File 'lib/heroix_api/processor.rb', line 9 def self.get_api_response(query) begin response = get_api_response!(query) rescue => e HeroixApi.log_error "Heroix API get_api_response with query #{HeroixApi.root_url}#{query} error: #{e.inspect}" end return HeroixApi::Data.from_response(response) end |