Class: OracleCloud::ImageLists
- Inherits:
-
Object
- Object
- OracleCloud::ImageLists
- Defined in:
- lib/oraclecloud/imagelists.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #all ⇒ Object
- #exist?(imagelist_name) ⇒ Boolean
-
#initialize(client) ⇒ ImageLists
constructor
A new instance of ImageLists.
- #private_imagelists ⇒ Object
- #public_imagelists ⇒ Object
Constructor Details
#initialize(client) ⇒ ImageLists
Returns a new instance of ImageLists.
22 23 24 |
# File 'lib/oraclecloud/imagelists.rb', line 22 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
20 21 22 |
# File 'lib/oraclecloud/imagelists.rb', line 20 def client @client end |
Instance Method Details
#all ⇒ Object
26 27 28 |
# File 'lib/oraclecloud/imagelists.rb', line 26 def all public_imagelists + private_imagelists end |
#exist?(imagelist_name) ⇒ Boolean
41 42 43 |
# File 'lib/oraclecloud/imagelists.rb', line 41 def exist?(imagelist_name) all.any? { |x| x.name == imagelist_name } end |
#private_imagelists ⇒ Object
36 37 38 39 |
# File 'lib/oraclecloud/imagelists.rb', line 36 def private_imagelists # TODO: tracked in PE-47 [] end |
#public_imagelists ⇒ Object
30 31 32 33 34 |
# File 'lib/oraclecloud/imagelists.rb', line 30 def public_imagelists client.http_get(:single, '/imagelist/oracle/public/')['result'].each_with_object([]) do |imagelist, memo| memo << OracleCloud::ImageList.new(imagelist) end end |