Class: Octopi::Key
- Octopi::Base
- Octopi::Key
Included Modules
Attributes
Instance Attributes
id | [RW] | public |
Sets the attribute id. |
---|---|---|---|
key | [RW] | public |
Sets the attribute key. |
title | [RW] | public |
Sets the attribute title. |
user | [R] | public |
Returns the value of attribute user. |
Constants Inherited from Octopi::Base
Constructor Summary
This class inherits a constructor from Octopi::Base.
Public Visibility
Public Class Method Details
add
public
add(opts)
[View source]
14 15 16 17 |
# File 'lib/octopi/key.rb', line 14 def self.add(opts) Api.api.post("/user/key/add", { :title => opts[:title], :key => opts[:key] }) end |
find_all
public
find_all
[View source]
10 11 12 |
# File 'lib/octopi/key.rb', line 10 def self.find_all Api.api.get("user/keys") end |
Public Instance Method Details
remove
public
remove
[View source]
19 20 21 22 |
# File 'lib/octopi/key.rb', line 19 def remove result = Api.api.post "/user/key/remove", :id => id keys = result["public_keys"].select { |k| k["title"] == title } end |