Class: ApiSixClient::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/api_six_client/base.rb

Direct Known Subclasses

BaseInt

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint: nil, auth_token: nil, debug_mode: false, dm: false) ⇒ Base

Returns a new instance of Base.



10
11
12
13
14
15
16
17
# File 'lib/api_six_client/base.rb', line 10

def initialize(endpoint: nil, auth_token: nil, debug_mode: false, dm: false)
  @endpoint = endpoint
  @auth_token = auth_token
  @debug_mode = debug_mode || dm

  override_defaults
  validate_config!
end

Instance Attribute Details

#endpointObject (readonly)

Returns the value of attribute endpoint.



8
9
10
# File 'lib/api_six_client/base.rb', line 8

def endpoint
  @endpoint
end

Instance Method Details

#delete(path, params = {}, headers = {}) ⇒ Object



35
36
37
# File 'lib/api_six_client/base.rb', line 35

def delete(path, params = {}, headers = {})
  request __method__, path, params, headers
end

#get(path, params = {}, headers = {}) ⇒ Object



23
24
25
# File 'lib/api_six_client/base.rb', line 23

def get(path, params = {}, headers = {})
  request __method__, path, params, headers
end

#patch(path, params = {}, headers = {}) ⇒ Object



27
28
29
# File 'lib/api_six_client/base.rb', line 27

def patch(path, params = {}, headers = {})
  request __method__, path, params, headers
end

#post(path, params = {}, headers = {}) ⇒ Object



19
20
21
# File 'lib/api_six_client/base.rb', line 19

def post(path, params = {}, headers = {})
  request __method__, path, params, headers
end

#put(path, params = {}, headers = {}) ⇒ Object



31
32
33
# File 'lib/api_six_client/base.rb', line 31

def put(path, params = {}, headers = {})
  request __method__, path, params, headers
end