Class: ClientAuth::Client
- Inherits:
-
Object
- Object
- ClientAuth::Client
- Defined in:
- lib/client_auth/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #get(path, params = {}) ⇒ Object
-
#initialize(config) ⇒ Client
constructor
A new instance of Client.
- #patch(path, params = {}) ⇒ Object
- #post(path, params = {}) ⇒ Object
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
#config ⇒ Object (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 |