Class AWS::Core::Options::Validator
In: lib/aws/core/options/validator.rb
Parent: Object

Given a hash of validation rules, a validator validate request options. Validations support:

  * rejecting unknown options
  * ensuring presence of required options
  * validating expected option types (e.g. hash, array, string,
    integer, etc).

After validating, a hash of request options is returned with with normalized values (with converted types).

Methods

Attributes

rules  [R]  @return [Hash]

Public Class methods

@param [Hash] rules A hash of option rules to validate against.

Public Instance methods

@overload validate!(request_options)

  @param [Hash] request_options The hash of options to validate.
  @raise [ArgumentError] Raised when the options do not validate.
  @return [Hash]

Protected Instance methods

Ensures the value is an array (or at least enumerable) and that the yielded values are valid.

Ensures the value is a hash and validates the hash context.

Proxies calls to the correct validation method based on the rules[:type].

[Validate]