Class: Joyent::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/joyent/key.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, attributes) ⇒ Key

Returns a new instance of Key.



5
6
7
8
9
10
# File 'lib/joyent/key.rb', line 5

def initialize(connection, attributes)
  @connection = connection

  @name = attributes["name"]
  @key = attributes["key"]
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



3
4
5
# File 'lib/joyent/key.rb', line 3

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/joyent/key.rb', line 3

def name
  @name
end

Instance Method Details

#deleteObject



12
13
14
# File 'lib/joyent/key.rb', line 12

def delete
  @connection.execute(:delete, "/keys/#{name}")
end