Class: Joyent::Machines

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

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Machines

Returns a new instance of Machines.



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

def initialize(connection)
  @connection = connection
end

Instance Method Details

#create(attributes = {}) ⇒ Object



15
16
17
# File 'lib/joyent/machines.rb', line 15

def create(attributes = {})
  Joyent::Machine.new(@connection, @connection.execute(:post, "/machines", attributes))
end

#get(id) ⇒ Object



11
12
13
# File 'lib/joyent/machines.rb', line 11

def get(id)
  Joyent::Machine.new(@connection, @connection.execute(:get, "/machines/#{id}"))
end

#listObject



7
8
9
# File 'lib/joyent/machines.rb', line 7

def list
  @connection.execute(:get, "/machines").map{|attributes| Joyent::Machine.new(@connection, attributes)}
end