Class: HP::Cloud::Images

Inherits:
FogCollection show all
Defined in:
lib/hpcloud/images.rb

Instance Attribute Summary

Attributes inherited from FogCollection

#items, #name

Instance Method Summary collapse

Methods inherited from FogCollection

#empty?, #filter, #get, #get_array, #unique

Constructor Details

#initializeImages

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