module Ethon::Easy::Http

def fabricate(url, action_name, options)

Returns:
  • (Easy::Ethon::Actionable) - The request instance.

Parameters:
  • options (Hash) -- The option hash.
  • action_name (String) -- The HTTP action name.
  • url (String) -- The url.

Other tags:
    Example: Return the action. -
def fabricate(url, action_name, options)
  constant_name = action_name.to_s.capitalize
  if Ethon::Easy::Http.const_defined?(constant_name)
    Ethon::Easy::Http.const_get(constant_name).new(url, options)
  else
    Ethon::Easy::Http::Custom.new(constant_name.upcase, url, options)
  end
end