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

Options Hash (options):


150
151
152
153
# File 'aws-sdk-resources/lib/aws-sdk-resources/operations.rb', line 150

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

Instance Attribute Details

#builderBuilder (readonly)


156
157
158
# File 'aws-sdk-resources/lib/aws-sdk-resources/operations.rb', line 156

def builder
  @builder
end

Instance Method Details

#arityObject


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

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

#call(options) ⇒ Resource


160
161
162
163
164
165
166
167
# File 'aws-sdk-resources/lib/aws-sdk-resources/operations.rb', line 160

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