Class: Octopi::Key

Included Modules

Octopi::Resource

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

VALID

Constructor Summary

This class inherits a constructor from Octopi::Base.

Public Visibility

Public Class Method Summary

add(opts)
find_all

Public Instance Method Summary

#remove

Public Instance Methods Inherited from Octopi::Base

error=, property, save

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
Generated on Friday, July 31 2009 at 05:01:55 PM by YARD 0.2.3.2 (ruby-1.8.6).