Class: ClientAuth::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/client_auth/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/client_auth/client.rb', line 7

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



3
4
5
# File 'lib/client_auth/client.rb', line 3

def config
  @config
end

Instance Method Details

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



11
12
13
14
# File 'lib/client_auth/client.rb', line 11

def get(path, params = {})
  resource = resource('GET', path, params)
  with_rescue { resource[URI.escape(path)].get(params: params) }
end

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



21
22
23
24
# File 'lib/client_auth/client.rb', line 21

def patch(path, params = {})
  resource = resource('PATCH', path)
  with_rescue { resource[URI.escape(path)].patch(params) }
end

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



16
17
18
19
# File 'lib/client_auth/client.rb', line 16

def post(path, params = {})
  resource = resource('POST', path)
  with_rescue { resource[URI.escape(path)].post(params) }
end