Class: OracleCloud::Shapes
- Inherits:
-
Object
- Object
- OracleCloud::Shapes
- Defined in:
- lib/oraclecloud/shapes.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #all ⇒ Object
- #exist?(shape_name) ⇒ Boolean
-
#initialize(client) ⇒ Shapes
constructor
A new instance of Shapes.
Constructor Details
#initialize(client) ⇒ Shapes
Returns a new instance of Shapes.
22 23 24 |
# File 'lib/oraclecloud/shapes.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/shapes.rb', line 20 def client @client end |
Instance Method Details
#all ⇒ Object
26 27 28 29 30 |
# File 'lib/oraclecloud/shapes.rb', line 26 def all client.http_get(:single, '/shape/')['result'].each_with_object([]) do |shape, memo| memo << OracleCloud::Shape.new(shape) end end |
#exist?(shape_name) ⇒ Boolean
32 33 34 |
# File 'lib/oraclecloud/shapes.rb', line 32 def exist?(shape_name) all.any? { |x| x.name == shape_name } end |