module Faraday
def default_adapter=(adapter)
def default_adapter=(adapter) @default_connection = nil @default_adapter = adapter end
def default_connection
-
connection
(Faraday::Connection
) --
Overloads:
-
default_connection=(connection)
-
default_connection
Returns:
-
(Faraday::Connection)
- a connection configured with
def default_connection @default_connection ||= Connection.new(default_connection_options) end
def default_connection_options
-
(Faraday::ConnectionOptions)
-
def default_connection_options @default_connection_options ||= ConnectionOptions.new end
def default_connection_options=(options)
-
options
(Hash, Faraday::ConnectionOptions
) --
def default_connection_options=(options) @default_connection = nil @default_connection_options = ConnectionOptions.from(options) end
def method_missing(name, *args, &block)
Internal: Proxies method calls on the Faraday constant to
def method_missing(name, *args, &block) if default_connection.respond_to?(name) default_connection.send(name, *args, &block) else super end end
def new(url = nil, options = {}, &block)
- Example: With everything in an options hash -
Example: With an URL argument and an options hash -
Example: With an URL argument -
Returns:
-
(Faraday::Connection)
-
Options Hash:
(**options)
-
:proxy
(Hash
) -- Hash of Proxy options. -
:ssl
(Hash
) -- Hash of SSL options. -
:request
(Hash
) -- Hash of request options. -
:headers
(Hash
) -- Hash of unencoded HTTP headers. -
:params
(Hash
) -- Hash of unencoded URI query params. -
:url
(String
) -- Base URL
Parameters:
-
options
(Hash
) -- -
url
(String, Hash
) -- The optional String base URL to use as a prefix
def new(url = nil, options = {}, &block) options = Utils.deep_merge(default_connection_options, options) Faraday::Connection.new(url, options, &block) end
def respond_to_missing?(symbol, include_private = false)
def respond_to_missing?(symbol, include_private = false) default_connection.respond_to?(symbol, include_private) || super end