Class: RatingsAggregator::Api
- Inherits:
-
Object
- Object
- RatingsAggregator::Api
- Defined in:
- lib/ratings_aggregator/api.rb
Constant Summary collapse
- API_URL =
"http://www.omdbapi.com/"
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
10 11 12 |
# File 'lib/ratings_aggregator/api.rb', line 10 def response @response end |
Instance Method Details
#call(params) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/ratings_aggregator/api.rb', line 11 def call(params) response = RestClient.get API_URL, params: params { code: response.code, data: JSON.parse(response.body) } end |