Class: DigitalOcean::Resource::SSHKey

Inherits:
Base
  • Object
show all
Defined in:
lib/digital_ocean/resource/ssh_key.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from DigitalOcean::Resource::Base

Instance Method Details

#add(args) ⇒ Object



16
17
18
19
20
# File 'lib/digital_ocean/resource/ssh_key.rb', line 16

def add(args)
  @connection.get('/ssh_keys/new') do |query|
    apply_params(query, args)
  end.body
end

#delete(id) ⇒ Object



12
13
14
# File 'lib/digital_ocean/resource/ssh_key.rb', line 12

def delete(id)
  @connection.get("/ssh_keys/#{id}/destroy").body
end

#edit(id, args) ⇒ Object



22
23
24
25
26
# File 'lib/digital_ocean/resource/ssh_key.rb', line 22

def edit(id, args)
  @connection.get("/ssh_keys/#{id}/edit") do |query|
    apply_params(query, args)
  end.body
end

#listObject



4
5
6
# File 'lib/digital_ocean/resource/ssh_key.rb', line 4

def list
  @connection.get('/ssh_keys').body
end

#show(id) ⇒ Object



8
9
10
# File 'lib/digital_ocean/resource/ssh_key.rb', line 8

def show(id)
  @connection.get("/ssh_keys/#{id}").body
end