lib/fog/azurerm/async_response.rb in fog-azure-rm-0.3.5 vs lib/fog/azurerm/async_response.rb in fog-azure-rm-0.3.6
- old
+ new
@@ -1,16 +1,19 @@
module Fog
module AzureRM
# class for Async Response
class AsyncResponse
- def initialize(model, promise)
+ def initialize(model, promise, delete_extra_resource = false)
@fog_model = model
@promise = promise
+ @delete_extra_resource = delete_extra_resource
end
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
def state
@promise.state
end