class RestKey

Attributes

content[RW]
name[RW]
type[RW]

Public Class Methods

new(name, content, type, url) click to toggle source
# File lib/stickshift-controller/app/models/rest_key.rb, line 4
def initialize(name, content, type, url)
  self.name= name
  self.content = content
  self.type = type || "ssh-rsa"

  self.links = {
    "GET" => Link.new("Get SSH key", "GET", URI::join(url, "user/keys/#{name}")),
    "UPDATE" => Link.new("Update SSH key", "PUT", URI::join(url, "user/keys/#{name}"), [
      Param.new("type", "string", "Type of Key", ["ssh-rsa", "ssh-dss"]),
      Param.new("content", "string", "The key portion of an rsa key (excluding ssh-rsa and comment)"),
    ]),
    "DELETE" => Link.new("Delete SSH key", "DELETE", URI::join(url, "user/keys/#{name}"))
  }
end

Public Instance Methods

to_xml(options={}) click to toggle source
# File lib/stickshift-controller/app/models/rest_key.rb, line 19
def to_xml(options={})
  options[:tag_name] = "key"
  super(options)
end