Module: IBM::Cloud::SDKHTTP::ChildMixin
- Defined in:
- lib/ibm/cloud/sdk_http/has_child.rb
Overview
Access a specific instance by either id or name depending on API.
Instance Method Summary collapse
-
#first_instance ⇒ Object
Return the first_instance returned from a collection get.
-
#instance(id) ⇒ Object
Get an instance of the collection object.
Instance Method Details
#first_instance ⇒ Object
Return the first_instance returned from a collection get.
17 18 19 |
# File 'lib/ibm/cloud/sdk_http/has_child.rb', line 17 def first_instance params(limit: 1).all.first end |
#instance(id) ⇒ Object
Get an instance of the collection object.
12 13 14 |
# File 'lib/ibm/cloud/sdk_http/has_child.rb', line 12 def instance(id) @instance.new(self, endpoint: id).refresh end |