Class: Fog::AzureRM::AsyncResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/azurerm/async_response.rb

Overview

class for Async Response

Instance Method Summary collapse

Constructor Details

#initialize(model, promise) ⇒ AsyncResponse

Returns a new instance of AsyncResponse.



5
6
7
8
# File 'lib/fog/azurerm/async_response.rb', line 5

def initialize(model, promise)
  @fog_model = model
  @promise = promise
end

Instance Method Details

#fulfilled?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/fog/azurerm/async_response.rb', line 27

def fulfilled?
  @promise.fulfilled?
end

#pending?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/fog/azurerm/async_response.rb', line 23

def pending?
  @promise.pending?
end

#reasonObject



19
20
21
# File 'lib/fog/azurerm/async_response.rb', line 19

def reason
  @promise.reason
end

#rejected?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/fog/azurerm/async_response.rb', line 31

def rejected?
  @promise.rejected?
end

#stateObject



15
16
17
# File 'lib/fog/azurerm/async_response.rb', line 15

def state
  @promise.state
end

#valueObject



10
11
12
13
# File 'lib/fog/azurerm/async_response.rb', line 10

def value
  response = @promise.value.body
  @fog_model.merge_attributes(@fog_model.class.parse(response))
end