class Patron::Session
def initialize(args = {}, &block)
- Yield: - self
Parameters:
-
args
(Hash
) -- options for the Session (same names as the writable attributes of the Session)
def initialize(args = {}, &block) # Allows accessors to be set via constructor hash. Ex: {:base_url => 'www.home.com'} args.each do |attribute, value| send("#{attribute}=", value) end # Allows accessors to be set via block. if block_given? yield self end @headers ||= {} @headers['User-Agent'] ||= Patron.user_agent_string @timeout ||= 5 @connect_timeout ||= 1 @max_redirects ||= 5 @auth_type ||= :basic @force_ipv4 ||= false end