Sha256: 4c2952f9241d9f6aa4d82b9f61b178ce6b4d8bc9b46029014d4cd7f15308a2ae

Contents?: true

Size: 791 Bytes

Versions: 1

Compression:

Stored size: 791 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 = '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.0 lib/comic_vine/api.rb