Class: HP::Cloud::Images
- Inherits:
-
FogCollection
- Object
- FogCollection
- HP::Cloud::Images
- Defined in:
- lib/hpcloud/images.rb
Instance Attribute Summary
Attributes inherited from FogCollection
Instance Method Summary collapse
- #create(item = nil) ⇒ Object
-
#initialize ⇒ Images
constructor
A new instance of Images.
- #matches(arg, item) ⇒ Object
Methods inherited from FogCollection
#empty?, #filter, #get, #get_array, #unique
Constructor Details
#initialize ⇒ Images
Returns a new instance of Images.
28 29 30 31 |
# File 'lib/hpcloud/images.rb', line 28 def initialize() super("image") @items = @connection.compute.images.all(:details=>true) end |
Instance Method Details
#create(item = nil) ⇒ Object
33 34 35 |
# File 'lib/hpcloud/images.rb', line 33 def create(item = nil) return ImageHelper.new(item) end |
#matches(arg, item) ⇒ Object
37 38 39 40 |
# File 'lib/hpcloud/images.rb', line 37 def matches(arg, item) return (arg == item.id.to_s) if arg.match(/^[0-9]+$/) return ((arg == item.id.to_s) || (item.name.to_s.match(arg))) end |