Class Relax::Request
In: lib/relax/request.rb
Parent: Object

Request is intended to be a parent class for requests passed to Service#call.

Methods

Public Class methods

Adds a template value to a request class. Equivalent to creating a parameter with a default value.

New takes an optional hash of default parameter values. When passed, the values will be set on the request if the key exists as a valid parameter name.

Specifies a parameter to create on the request class.

Options:

  • :type: An optional custom data type for the parameter. This must be a descendent of Request.
  • :value: The default value for this parameter.

Public Instance methods

Converts this request into a Query object.

Converts this request into a query string for use in a URL.

Protected Instance methods

Converts a complex key (i.e. a parameter with a custom type) when the Request is converted to a query. By default, this means the key name and the parameter name separated by two underscores. This method can be overridden by child classes.

Converts a key when the Request is converted to a query. By default, no conversion actually takes place, but this method can be overridden by child classes to perform standard manipulations, such as replacing underscores.

[Validate]