Sha256: d78c60909c7d282ef3c0042769b406c8252cf097e61b561c0d242aae8d1d7209

Contents?: true

Size: 489 Bytes

Versions: 1

Compression:

Stored size: 489 Bytes

Contents

# frozen_string_literal: true

class Hphones
  ##
  # Represents an API request
  #
  class Request
    attr_reader :api, :endpoint

    def initialize(api, endpoint)
      @api = api
      @endpoint = endpoint
    end

    def get(params = {})
      conn = api.connection
      compiled_params = params.merge('apikey' => api.api_key)
      Hphones::Response.new(self, conn.get(api.base_path, compiled_params))
    end

    def response_type
      endpoint.response_type
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hphones-ruby-0.0.2 lib/hphones/request.rb