Module: Spice::Connection::Clients
- Included in:
- Spice::Connection
- Defined in:
- lib/spice/connection/clients.rb
Instance Method Summary collapse
-
#client(name) ⇒ Spice::Client
Retrieve a single client.
-
#clients(options = Mash.new) ⇒ Array<Spice::Client>, Array
A collection of clients.
-
#create_client(params = Mash.new) ⇒ Object
def client.
-
#delete_client(name) ⇒ Object
def update_client.
-
#reregister_client(name) ⇒ Object
def delete_client.
-
#update_client(name, params = Mash.new) ⇒ Object
def create_client.
Instance Method Details
#client(name) ⇒ Spice::Client
Retrieve a single client
20 21 22 23 |
# File 'lib/spice/connection/clients.rb', line 20 def client(name) attributes = get("/clients/#{name}") Spice::Client.get_or_new(attributes) end |
#clients(options = Mash.new) ⇒ Array<Spice::Client>, Array
A collection of clients
10 11 12 |
# File 'lib/spice/connection/clients.rb', line 10 def clients(=Mash.new) search('client', ) end |
#create_client(params = Mash.new) ⇒ Object
def client
25 26 27 28 |
# File 'lib/spice/connection/clients.rb', line 25 def create_client(params=Mash.new) attributes = post("/clients", params) Spice::Client.get_or_new(attributes) end |
#delete_client(name) ⇒ Object
def update_client
35 36 37 38 |
# File 'lib/spice/connection/clients.rb', line 35 def delete_client(name) client = delete("/clients/#{name}") nil end |
#reregister_client(name) ⇒ Object
def delete_client
40 41 42 43 |
# File 'lib/spice/connection/clients.rb', line 40 def reregister_client(name) attributes = put("/clients/#{name}", :private_key => true) Spice::Client.get_or_new(attributes) end |
#update_client(name, params = Mash.new) ⇒ Object
def create_client
30 31 32 33 |
# File 'lib/spice/connection/clients.rb', line 30 def update_client(name, params=Mash.new) attributes = put("/clients/#{name}", params) Spice::Client.get_or_new(attributes) end |