Sha256: 04a7dc723447a28143d251e62618b08fdd62faafac83295c0e6328d77d98eba4

Contents?: true

Size: 1.98 KB

Versions: 932

Compression:

Stored size: 1.98 KB

Contents

module Aws
  module Resources
    class Documenter
      class WaiterOperationDocumenter < BaseOperationDocumenter

        def docstring
          super + ' ' + <<-DOCSTRING.lstrip
Waits until this #{resource_class_name} is #{state}. This method
waits by polling {Client##{api_request_name}} until successful. An error is
raised after a configurable number of failed checks.

This waiter uses the following defaults:

| Configuration   | Default                |
|-----------------|------------------------|
| `#delay`        | #{waiter.delay}        |
| `#max_attempts` | #{waiter.max_attempts} |

You can modify defaults and register callbacks by passing a block argument.
@yieldparam [Waiters::Waiter] waiter
@raise [Waiters::Errors::WaiterFailed]
@see Client#wait_until
          DOCSTRING
        end

        def return_tag
          tag("@return [#{resource_class_name}] #{return_message}")
        end

        def return_message
          if @operation.path
            "Returns a copy of this #{resource_class_name} with loaded data."
          else
            "Returns a copy of this #{resource_class_name} that is not loaded."
          end
        end

        def state
          operation_name.to_s.sub('wait_until_', '')
        end

        def waiter
          @resource_class.client_class.waiters.waiter(@operation.waiter_name)
        end

        def api_request
          @resource_class.client_class.api.operation(api_request_name)
        end

        def api_request_name
          waiter.poller.operation_name
        end

        def option_tags
          []
        end

        def example_tags
          example = <<-EXAMPLE.strip
@example Basic usage
  #{variable_name}.#{operation_name}

@example Modify default configuration
  #{variable_name}.#{operation_name} do |w|
     w.interval = 10
     w.max_attempts = 100
     w.before_attempt { |count| ... }
     w.before_wait do { |count, prev_resp| ... }
  end
          EXAMPLE
          [tag(example)]
        end

      end
    end
  end
end

Version data entries

932 entries across 932 versions & 2 rubygems

Version Path
aws-sdk-resources-2.3.3 lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb
aws-sdk-resources-2.3.2 lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb
aws-sdk-resources-2.3.1 lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb
aws-sdk-resources-2.3.0 lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb
aws-sdk-resources-2.2.37 lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb
aws-sdk-resources-2.2.36 lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb
aws-sdk-resources-2.2.35 lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb
aws-sdk-resources-2.2.34 lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb
aws-sdk-resources-2.2.33 lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb
aws-sdk-resources-2.2.32 lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb
aws-sdk-resources-2.2.31 lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb
aws-sdk-resources-2.2.30 lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb