Sha256: d3e8cd38345f5cc8ba0979f132b242be1bf53deb3c6a5af2c6b2cddf13f33f73

Contents?: true

Size: 799 Bytes

Versions: 1

Compression:

Stored size: 799 Bytes

Contents

require 'json'

require 'comic_vine/api/api_methods'
require 'comic_vine/api/http_service'
require 'comic_vine/api/request'
require 'comic_vine/api/response'
require 'comic_vine/api/version'

module ComicVine
  class Api
    include ApiMethods

    class << self
      attr_accessor :http_service
    end

    self.http_service = HTTPService

    DEFAULT_SERVER = 'https://comicvine.gamespot.com'.freeze

    attr_reader :api_key, :options

    def initialize(api_key, options = {})
      @api_key = api_key
      @options = options

      initial_define_api_methods
    end

    def api_call(path, args, options = {})
      request = Request.new(
        path: path, args: args.merge(api_key: api_key), options: options
      )
      self.class.http_service.make_request(request)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
comic_vine-api-0.1.1 lib/comic_vine/api.rb