Class: Vra::Resources
- Inherits:
-
Object
- Object
- Vra::Resources
- Defined in:
- lib/vra/resources.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Class Method Summary collapse
-
.all(client) ⇒ Array[Vra::Resource]
-
returns an array of all the resources owned by the user.
-
Instance Method Summary collapse
-
#all_resources ⇒ Array[Vra::Resource]
-
returns an array of all the resources owned by the user.
-
- #by_id(id) ⇒ Object
-
#initialize(client) ⇒ Resources
constructor
A new instance of Resources.
Constructor Details
#initialize(client) ⇒ Resources
Returns a new instance of Resources.
25 26 27 |
# File 'lib/vra/resources.rb', line 25 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
23 24 25 |
# File 'lib/vra/resources.rb', line 23 def client @client end |
Class Method Details
.all(client) ⇒ Array[Vra::Resource]
Returns - returns an array of all the resources owned by the user.
31 32 33 34 |
# File 'lib/vra/resources.rb', line 31 def self.all(client) items = client.http_get_paginated_array!("/catalog-service/api/consumer/resources") items.map { |item| Vra::Resource.new(client, data: item) } end |
Instance Method Details
#all_resources ⇒ Array[Vra::Resource]
Returns - returns an array of all the resources owned by the user.
37 38 39 |
# File 'lib/vra/resources.rb', line 37 def all_resources self.class.all(client) end |