Class: Thanos::API::Client
- Inherits:
-
Object
- Object
- Thanos::API::Client
- Defined in:
- lib/thanos/api/client.rb
Constant Summary collapse
- API_VERSION =
'v1'- API_ENDPOINT =
'http://gateway.marvel.com'
Instance Method Summary collapse
Instance Method Details
#authentication ⇒ Object
21 22 23 |
# File 'lib/thanos/api/client.rb', line 21 def authentication Authentication.get end |
#endpoint ⇒ Object
17 18 19 |
# File 'lib/thanos/api/client.rb', line 17 def endpoint "#{API_ENDPOINT}/#{API_VERSION}/public" end |
#get(resource, options) ⇒ Object
11 12 13 14 15 |
# File 'lib/thanos/api/client.rb', line 11 def get(resource, ) url = "#{endpoint}/#{resource}" response = RestClient.get(url, params: .merge(authentication)) Thanos::API::Response.new(response) end |