You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::Resources::Operations::HasOperation

Inherits:
Base
  • Object
show all
Defined in:
aws-sdk-resources/lib/aws-sdk-resources/operations.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#source

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ HasOperation

Returns a new instance of HasOperation

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):



167
168
169
170
# File 'aws-sdk-resources/lib/aws-sdk-resources/operations.rb', line 167

def initialize(options = {})
  @builder = option(:builder, options)
  super
end

Instance Attribute Details

#builderBuilder (readonly)

Returns:



173
174
175
# File 'aws-sdk-resources/lib/aws-sdk-resources/operations.rb', line 173

def builder
  @builder
end

Instance Method Details

#arityObject



186
187
188
# File 'aws-sdk-resources/lib/aws-sdk-resources/operations.rb', line 186

def arity
  @builder.sources.count { |s| BuilderSources::Argument === s }
end

#call(options) ⇒ Resource

Returns:



177
178
179
180
181
182
183
184
# File 'aws-sdk-resources/lib/aws-sdk-resources/operations.rb', line 177

def call(options)
  if argc(options) == arity
    @builder.build(options)
  else
    msg = "wrong number of arguments (#{argc(options)} for #{arity})"
    raise ArgumentError, msg
  end
end