Class: Joyent::Packages

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

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Packages

Returns a new instance of Packages.



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

def initialize(connection)
  @connection = connection
end

Instance Method Details

#get(name) ⇒ Object



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

def get(name)
  Joyent::Package.new(@connection.execute(:get, "/packages/#{name}"))
end

#listObject



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

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