Sha256: ec21bfff0c412eae1ebe6e5d104742bd6bc283f70e4a93cbbfb50bbe0229135d

Contents?: true

Size: 787 Bytes

Versions: 2

Compression:

Stored size: 787 Bytes

Contents

module Fog
  module AzureRM
    # class for Async Response
    class AsyncResponse
      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

      def reason
        @promise.reason
      end

      def pending?
        @promise.pending?
      end

      def fulfilled?
        @promise.fulfilled?
      end

      def rejected?
        @promise.rejected?
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-azure-rm-0.3.7 lib/fog/azurerm/async_response.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/async_response.rb