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, delete_extra_resource = false) ⇒ AsyncResponse



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

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

Instance Method Details

#fulfilled?Boolean



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

def fulfilled?
  @promise.fulfilled?
end

#pending?Boolean



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

def pending?
  @promise.pending?
end

#reasonObject



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

def reason
  @promise.reason
end

#rejected?Boolean



34
35
36
# File 'lib/fog/azurerm/async_response.rb', line 34

def rejected?
  @promise.rejected?
end

#stateObject



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

def state
  @promise.state
end

#valueObject



11
12
13
14
15
16
# File 'lib/fog/azurerm/async_response.rb', line 11

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