class Aws::Resources::Documenter::HasManyOperationDocumenter

Public Instance Methods

batch_examples_tag() click to toggle source
# File lib/aws-sdk-resources/documenter/has_many_operation_documenter.rb, line 45
def batch_examples_tag
  example = []
  example << "@example Batch operations callable on the returned collection"
  target_resource_batch_operations.each do |name, operation|
    if operation.respond_to?(:request)
      example << ""
      example << "  # calls Client##{operation.request.method_name} on each batch"
      example << "  #{variable_name}.#{@operation_name}.#{name}"
    end
  end
  tag(example.join("\n"))
end
docstring() click to toggle source
# File lib/aws-sdk-resources/documenter/has_many_operation_documenter.rb, line 6
        def docstring
          super + ' ' +"Returns a {Resources::Collection Collection} of {#{target_resource_class_name}}
resources. No API requests are made until you call an enumerable method on the
collection. {#{called_operation}} will be called multiple times until every
{#{target_resource_class_name}} has been yielded.
".lstrip
        end
enumerate_example_tag() click to toggle source
# File lib/aws-sdk-resources/documenter/has_many_operation_documenter.rb, line 27
        def enumerate_example_tag
          tag("@example Enumerating {#{target_resource_class_name}} resources.
  #{variable_name}.#{@operation_name}.each do |#{target_resource_class_name.downcase}|
    # yields each #{target_resource_class_name.downcase}
  end
".strip)
        end
enumerate_with_limit_example_tag() click to toggle source
# File lib/aws-sdk-resources/documenter/has_many_operation_documenter.rb, line 36
        def enumerate_with_limit_example_tag
          tag("@example Enumerating {#{target_resource_class_name}} resources with a limit.
  #{variable_name}.#{@operation_name}.limit(10).each do |#{target_resource_class_name.downcase}|
    # yields at most 10 #{@operation_name}
  end
".strip)
        end
example_tags() click to toggle source
# File lib/aws-sdk-resources/documenter/has_many_operation_documenter.rb, line 19
def example_tags
  tags = super
  tags << enumerate_example_tag
  tags << enumerate_with_limit_example_tag
  tags << batch_examples_tag if target_resource_batches?
  tags
end
return_tag() click to toggle source
# File lib/aws-sdk-resources/documenter/has_many_operation_documenter.rb, line 15
def return_tag
  tag("@return [Collection<#{target_resource_class_name}>]")
end
target_resource_batch_operations() click to toggle source
# File lib/aws-sdk-resources/documenter/has_many_operation_documenter.rb, line 62
def target_resource_batch_operations
  target_resource_class.batch_operations
end
target_resource_batches?() click to toggle source
# File lib/aws-sdk-resources/documenter/has_many_operation_documenter.rb, line 58
def target_resource_batches?
  target_resource_batch_operations.count > 0
end