Class: ApiMapper::Client
- Inherits:
-
Object
- Object
- ApiMapper::Client
- Defined in:
- lib/api_mapper/client.rb
Instance Attribute Summary collapse
-
#router ⇒ Object
writeonly
Sets the attribute router.
Instance Method Summary collapse
- #authorization(authorization) ⇒ Object
- #get(path) ⇒ Object
-
#initialize(base_url) ⇒ Client
constructor
A new instance of Client.
- #patch(path, body) ⇒ Object
- #post(path, body) ⇒ Object
Constructor Details
Instance Attribute Details
#router=(value) ⇒ Object (writeonly)
Sets the attribute router
4 5 6 |
# File 'lib/api_mapper/client.rb', line 4 def router=(value) @router = value end |
Instance Method Details
#authorization(authorization) ⇒ Object
23 24 25 |
# File 'lib/api_mapper/client.rb', line 23 def () @authorization = end |
#get(path) ⇒ Object
11 12 13 |
# File 'lib/api_mapper/client.rb', line 11 def get(path) mapper(:get, path).call(response(:get, path).body) end |
#patch(path, body) ⇒ Object
15 16 17 |
# File 'lib/api_mapper/client.rb', line 15 def patch(path, body) mapper(:patch, path).call(response(:patch, path, body).body) end |
#post(path, body) ⇒ Object
19 20 21 |
# File 'lib/api_mapper/client.rb', line 19 def post(path, body) mapper(:post, path).call(response(:post, path, body).body) end |