class Aws::Resources::Operations::DeprecatedOperation

@api private

Public Class Methods

new(options = {}) click to toggle source
# File lib/aws-sdk-resources/operations.rb, line 244
def initialize(options = {})
  @name = options[:name]
  @deprecated_name = options[:deprecated_name]
  @resource_class = options[:resource_class]
  @operation = @resource_class.batch_operation(@name)
  @warned = false
end

Private Class Methods

define(options = {}) click to toggle source
# File lib/aws-sdk-resources/operations.rb, line 270
def define(options = {})
  klass = options[:resource_class]
  deprecated_name = options[:deprecated_name]
  klass.add_batch_operation(deprecated_name, new(options))
end

Public Instance Methods

call(*args) click to toggle source
# File lib/aws-sdk-resources/operations.rb, line 252
def call(*args)
  unless @warned
    @warned = true
    warn(deprecation_warning)
  end
  @operation.call(*args)
end

Private Instance Methods

deprecation_warning() click to toggle source
# File lib/aws-sdk-resources/operations.rb, line 262
def deprecation_warning
  "DEPRECATION WARNING: called deprecated batch method " +
  "`##{@deprecated_name}` on a batch of `#{@resource_class.name}` " +
  "objects; use `##{@name}` instead"
end