Module Ethon::Easy::Http::Actionable
In: lib/ethon/easy/http/actionable.rb

This module represents a Http Action and is a factory for more real actions like GET, HEAD, POST and PUT.

Methods

form   new   options   params   params_encoding   query_options   set_form   set_params   setup   url  

Constants

QUERY_OPTIONS = [ :params, :body, :params_encoding ]

Public Class methods

Create a new action.

@example Create a new action.

  Action.new("www.example.com", {})

@param [ String ] url The url. @param [ Hash ] options The options.

@return [ Action ] A new action.

Public Instance methods

Return the form.

@example Return form.

  action.form

@return [ Form ] The form.

Return the options hash.

@example Return options.

  action.options

@return [ Hash ] The options.

Return the params.

@example Return params.

  action.params

@return [ Params ] The params.

Get the requested array encoding. By default it‘s :typhoeus, but it can also be set to :rack.

@example Get encoding from options

  action.params_encoding

Returns the query options hash.

@example Return query options.

  action.query_options

@return [ Hash ] The query options.

Setup request with form.

@example Setup nothing.

  action.set_form(easy)

@param [ Easy ] easy The easy to setup.

Setup request with params.

@example Setup nothing.

  action.set_params(easy)

@param [ Easy ] easy The easy to setup.

Setup everything necessary for a proper request.

@example setup.

  action.setup(easy)

@param [ easy ] easy the easy to setup.

Return the url.

@example Return url.

  action.url

@return [ String ] The url.

[Validate]