Sha256: 28d8e77a7d7fa8c7cde7f01af58e18c630e39142f4494d39bae551063d30142f

Contents?: true

Size: 572 Bytes

Versions: 2

Compression:

Stored size: 572 Bytes

Contents

require 'rest_client'
require 'thanos/api/response'
require 'thanos/api/authentication'

module Thanos
  module API
    class Client
      API_VERSION = 'v1'
      API_ENDPOINT = 'http://gateway.marvel.com'

      def get(resource, options)
        url = "#{endpoint}/#{resource}"
        response = RestClient.get(url, params: options.merge(authentication))
        Thanos::API::Response.new(response)
      end

      def endpoint
        "#{API_ENDPOINT}/#{API_VERSION}/public"
      end

      def authentication
        Authentication.get
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thanos-0.6.0 lib/thanos/api/client.rb
thanos-0.5.0 lib/thanos/api/client.rb