Class: Vra::Requests

Inherits:
Object
  • Object
show all
Defined in:
lib/vra/requests.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Requests

Returns a new instance of Requests.



22
23
24
# File 'lib/vra/requests.rb', line 22

def initialize(client)
  @client = client
end

Instance Method Details

#all_requestsObject



26
27
28
29
30
31
32
33
34
35
# File 'lib/vra/requests.rb', line 26

def all_requests
  requests = []

  items = @client.http_get_paginated_array!("/catalog-service/api/consumer/requests")
  items.each do |item|
    requests << Vra::Request.new(@client, item["id"])
  end

  requests
end

#by_id(id) ⇒ Object



37
38
39
# File 'lib/vra/requests.rb', line 37

def by_id(id)
  Vra::Request.new(@client, id)
end