Class: Twelve::API::Clients::Proxy
- Inherits:
-
ResourceProxy
- Object
- ResourceProxy
- Twelve::API::Clients::Proxy
- Defined in:
- lib/twelve/api/clients.rb
Overview
Clients::Proxy inherits from Twelve::Proxy and enables defining methods on the proxy object
Instance Attribute Summary
Attributes inherited from ResourceProxy
#attributes, #connection, #path_prefix
Instance Method Summary collapse
-
#create(attributes) ⇒ Object
Creates an API client.
-
#destroy ⇒ Object
Deletes an API client.
-
#subject ⇒ Object
Get API clients.
Methods inherited from ResourceProxy
Constructor Details
This class inherits a constructor from Twelve::ResourceProxy
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Twelve::ResourceProxy
Instance Method Details
#create(attributes) ⇒ Object
Creates an API client
attributes - Hash of attributes
Returns json
22 23 24 |
# File 'lib/twelve/api/clients.rb', line 22 def create(attributes) connection.post(path_prefix, attributes).body['client'] end |
#destroy ⇒ Object
Deletes an API client
key - String of key
Returns json
32 33 34 |
# File 'lib/twelve/api/clients.rb', line 32 def destroy connection.delete(path_prefix).body['client'] end |
#subject ⇒ Object
Get API clients
Returns json
40 41 42 |
# File 'lib/twelve/api/clients.rb', line 40 def subject @subject ||= connection.get(path_prefix).body['clients'] end |