Class: Codelocks::Request

Inherits:
Model
  • Object
show all
Defined in:
lib/codelocks/request.rb

Class Method Summary collapse

Methods inherited from Model

all, #client

Class Method Details

.create(path, params = {}) ⇒ Codelocks::NetCode::Response

Perform a request against the NetCode API

Parameters:

  • path (String)

    the URI path to perform the request against

  • params (Hash) (defaults to: {})

    defined in Codelocks::NetCode

Returns:

  • (Codelocks::NetCode::Response)


11
12
13
14
15
16
17
# File 'lib/codelocks/request.rb', line 11

def create(path, params = {})
  response = client.connection.get(path, default_params.merge(params)) do |req|
    req.headers['x-api-key'] = client.api_key
  end

  Response.new(response)
end