Class: Joyent::Packages
- Inherits:
-
Object
- Object
- Joyent::Packages
- Defined in:
- lib/joyent/packages.rb
Instance Method Summary collapse
- #get(name) ⇒ Object
-
#initialize(connection) ⇒ Packages
constructor
A new instance of Packages.
- #list ⇒ Object
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 |
#list ⇒ Object
7 8 9 |
# File 'lib/joyent/packages.rb', line 7 def list @connection.execute(:get, "/packages").map{|attributes| Joyent::Package.new(attributes)} end |