Class: OvirtSDK4::Future

Inherits:
Object
  • Object
show all
Defined in:
lib/ovirtsdk4/service.rb

Overview

Instances of this class are returned for operatoins that specify the wait: false parameter.

Instance Method Summary collapse

Instance Method Details

#inspectString

Returns a string representation of the future.

Returns:

  • (String)

    The string representation.



55
56
57
# File 'lib/ovirtsdk4/service.rb', line 55

def inspect
  "#<#{self.class.name}:#{@request.method} #{@request.url}>"
end

#to_sString

Returns a string representation of the future.

Returns:

  • (String)

    The string representation.



64
65
66
# File 'lib/ovirtsdk4/service.rb', line 64

def to_s
  inspect
end

#waitObject

Waits till the result of the operation that created this future is available.

Returns:

  • (Object)

    The result of the operation that created this future.



43
44
45
46
47
48
# File 'lib/ovirtsdk4/service.rb', line 43

def wait
  response = @service.connection.wait(@request)
  raise response if response.is_a?(Exception)

  @block.call(response)
end