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.



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

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

#to_sString

Returns a string representation of the future.

Returns:

  • (String)

    The string representation.



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

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
# 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