Class: Octopi::Key
Constant Summary
Constant Summary
Constants inherited from Base
Instance Attribute Summary (collapse)
-
- (Object) id
Returns the value of attribute id.
-
- (Object) key
Returns the value of attribute key.
-
- (Object) title
Returns the value of attribute title.
-
- (Object) user
readonly
Returns the value of attribute user.
Attributes inherited from Base
Class Method Summary (collapse)
Instance Method Summary (collapse)
Methods included from Resource
Methods inherited from Base
#error=, #initialize, #property, #save
Constructor Details
This class inherits a constructor from Octopi::Base
Instance Attribute Details
- (Object) id
Returns the value of attribute id
5 6 7 |
# File 'lib/octopi/key.rb', line 5 def id @id end |
- (Object) key
Returns the value of attribute key
5 6 7 |
# File 'lib/octopi/key.rb', line 5 def key @key end |
- (Object) title
Returns the value of attribute title
5 6 7 |
# File 'lib/octopi/key.rb', line 5 def title @title end |
- (Object) user (readonly)
Returns the value of attribute user
8 9 10 |
# File 'lib/octopi/key.rb', line 8 def user @user end |
Class Method Details
+ (Object) add(options = {})
14 15 16 17 18 |
# File 'lib/octopi/key.rb', line 14 def self.add(={}) ensure_hash() Api.api.post("/user/key/add", { :title => [:title], :key => [:key], :cache => false }) end |
+ (Object) find_all
10 11 12 |
# File 'lib/octopi/key.rb', line 10 def self.find_all Api.api.get("user/keys") end |
Instance Method Details
- (Object) remove
20 21 22 23 |
# File 'lib/octopi/key.rb', line 20 def remove result = Api.api.post "/user/key/remove", { :id => id, :cache => false } keys = result["public_keys"].select { |k| k["title"] == title } end |