Module: Kongkit::Client::Request

Included in:
Kongkit::Client
Defined in:
lib/kongkit/client/request.rb

Instance Method Summary collapse

Instance Method Details

#delete(path, options = {}) ⇒ Boolean

HTTP DELETE request

Parameters:

  • path (String)

    The API path

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

    The options

Returns:

  • (Boolean)

    `true` if successfully respondeds


39
40
41
42
# File 'lib/kongkit/client/request.rb', line 39

def delete(path, options = {})
  response = self.class.delete(path, options)
  response.success?
end

#get(path, options = {}) ⇒ Kongkit::Client::Resource

HTTP GET request

Parameters:

  • path (String)

    The API path

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

    The options

Returns:


9
10
11
12
# File 'lib/kongkit/client/request.rb', line 9

def get(path, options = {})
  response = self.class.get(path, options)
  parse(response)
end

#patch(path, options = {}) ⇒ Kongkit::Client::Resource

HTTP PATCH request

Parameters:

  • path (String)

    The API path

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

    The options

Returns:


29
30
31
32
# File 'lib/kongkit/client/request.rb', line 29

def patch(path, options = {})
  response = self.class.patch(path, options)
  parse(response)
end

#post(path, options = {}) ⇒ Kongkit::Client::Resource

HTTP POST request

Parameters:

  • path (String)

    The API path

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

    The options

Returns:


19
20
21
22
# File 'lib/kongkit/client/request.rb', line 19

def post(path, options = {})
  response = self.class.post(path, options)
  parse(response)
end