class Aws::Resources::Request

Attributes

method_name[R]

@return [String] Name of the method called on the client when this

operation is called.
params[R]

@return [Array<RequestParams::Param>]

Public Class Methods

new(options = {}) click to toggle source

@option options [required, String] :method_name @option options [Array<RequestParams::Param>] :params ([]) A list of

request params to apply to the request when called.
# File lib/aws-sdk-resources/request.rb, line 8
def initialize(options = {})
  @method_name = options[:method_name]
  @params = options[:params] || []
end

Public Instance Methods

call(options) click to toggle source

@option options [required, Resource] :resource @option options [Array<Mixed>] :args @return [Seahorse::Client::Response]

# File lib/aws-sdk-resources/request.rb, line 23
def call(options)
  client(options).send(@method_name, req_params(options), &options[:block])
end

Private Instance Methods

client(options) click to toggle source
# File lib/aws-sdk-resources/request.rb, line 29
def client(options)
  Array(options[:resource]).first.client
end
req_params(options) click to toggle source
# File lib/aws-sdk-resources/request.rb, line 33
def req_params(options)
  RequestParams::ParamHash.new(@params).build(options)
end