Class: Colombo::SshKey

Inherits:
Resource show all
Defined in:
lib/colombo/ssh_key.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Colombo::Resource

Instance Attribute Details

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/colombo/ssh_key.rb', line 6

def id
  @id
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/colombo/ssh_key.rb', line 6

def name
  @name
end

#ssh_pub_keyObject

Returns the value of attribute ssh_pub_key.



6
7
8
# File 'lib/colombo/ssh_key.rb', line 6

def ssh_pub_key
  @ssh_pub_key
end

Instance Method Details

#destroyObject



8
9
10
11
12
13
# File 'lib/colombo/ssh_key.rb', line 8

def destroy
  @client.request(:get, "/ssh_keys/#{self.id}/destroy/") do |response|
    return true
  end
  return false
end

#update(options = {}) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/colombo/ssh_key.rb', line 24

def update(options={})
  params = {
    :ssh_pub_key => options[:ssh_pub_key]
  }
  response = @client.request(:get, "/ssh_keys/#{self.id}/edit/", params) do |response|
    return true
  end
  return false
end