Class: Fog::AzureRM::AsyncResponse
- Inherits:
-
Object
- Object
- Fog::AzureRM::AsyncResponse
- Defined in:
- lib/fog/azurerm/async_response.rb
Overview
class for Async Response
Instance Method Summary collapse
- #fulfilled? ⇒ Boolean
-
#initialize(model, promise) ⇒ AsyncResponse
constructor
A new instance of AsyncResponse.
- #pending? ⇒ Boolean
- #reason ⇒ Object
- #rejected? ⇒ Boolean
- #state ⇒ Object
- #value ⇒ Object
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
27 28 29 |
# File 'lib/fog/azurerm/async_response.rb', line 27 def fulfilled? @promise.fulfilled? end |
#pending? ⇒ Boolean
23 24 25 |
# File 'lib/fog/azurerm/async_response.rb', line 23 def pending? @promise.pending? end |
#reason ⇒ Object
19 20 21 |
# File 'lib/fog/azurerm/async_response.rb', line 19 def reason @promise.reason end |
#rejected? ⇒ Boolean
31 32 33 |
# File 'lib/fog/azurerm/async_response.rb', line 31 def rejected? @promise.rejected? end |
#state ⇒ Object
15 16 17 |
# File 'lib/fog/azurerm/async_response.rb', line 15 def state @promise.state end |
#value ⇒ Object
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 |