class Ethon::Easies::Params

This class represents http request parameters.

def empty?

Returns:
  • (Boolean) - True if params is empty, else false.

Other tags:
    Example: Return if params is empty. -
def empty?
  @params.empty?
end

def initialize(params)

Returns:
  • (Params) - A new Params.

Parameters:
  • params (Hash) -- The params to use.

Other tags:
    Example: Create a new Params. -
def initialize(params)
  @params = params || {}
end

def query_pairs

Returns:
  • (Array) - The query pairs.

Other tags:
    Example: Return the query pairs. -
def query_pairs
  @query_pairs ||= build_query_pairs(@params)
end

def to_s

Returns:
  • (String) - The string representation.

Other tags:
    Example: Return string representation. -
def to_s
  query_pairs.map{|pair| pair.map{|e| escape ? CGI::escape(e.to_s) : e }.join("=")}.join('&')
end