Class: ChimeraHttpClient::Connection

Inherits:
Base
  • Object
show all
Defined in:
lib/chimera_http_client/connection.rb

Constant Summary

Constants inherited from Base

Base::USER_AGENT

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Connection

Returns a new instance of Connection.



6
7
8
9
10
# File 'lib/chimera_http_client/connection.rb', line 6

def initialize(options = {})
  super(options)

  define_bang_methods
end

Instance Method Details

#delete(endpoint, options = {}) ⇒ Object



32
33
34
# File 'lib/chimera_http_client/connection.rb', line 32

def delete(endpoint, options = {})
  run(:delete, endpoint, options.merge(body_optional: true))
end

#get(endpoint, options = {}) ⇒ Object



16
17
18
# File 'lib/chimera_http_client/connection.rb', line 16

def get(endpoint, options = {})
  run(:get, endpoint, options.merge(body_optional: true))
end

#patch(endpoint, options = {}) ⇒ Object



28
29
30
# File 'lib/chimera_http_client/connection.rb', line 28

def patch(endpoint, options = {})
  run(:patch, endpoint, options)
end

#post(endpoint, options = {}) ⇒ Object



20
21
22
# File 'lib/chimera_http_client/connection.rb', line 20

def post(endpoint, options = {})
  run(:post, endpoint, options)
end

#put(endpoint, options = {}) ⇒ Object



24
25
26
# File 'lib/chimera_http_client/connection.rb', line 24

def put(endpoint, options = {})
  run(:put, endpoint, options)
end

#requestObject



12
13
14
# File 'lib/chimera_http_client/connection.rb', line 12

def request
  @request ||= Request.new(logger: @logger)
end