Class: Octopi::Key
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(api, data, user = nil) ⇒ Key
constructor
A new instance of Key.
- #remove! ⇒ Object
Methods included from Resource
Methods inherited from Base
Constructor Details
#initialize(api, data, user = nil) ⇒ Key
Returns a new instance of Key.
7 8 9 10 |
# File 'lib/octopi/key.rb', line 7 def initialize(api, data, user = nil) super api, data @user = user end |
Instance Attribute Details
#user ⇒ Object (readonly)
Returns the value of attribute user.
5 6 7 |
# File 'lib/octopi/key.rb', line 5 def user @user end |
Instance Method Details
#remove! ⇒ Object
12 13 14 15 16 |
# File 'lib/octopi/key.rb', line 12 def remove! result = @api.post "/user/key/remove", :id => id keys = result["public_keys"].select { |k| k["title"] == title } keys.empty? end |