class HTTP::CookieJar::AbstractSaver
An abstract superclass for all saver classes.
def class_to_symbol(klass) # :nodoc:
def class_to_symbol(klass) # :nodoc: klass.name[/[^:]+?(?=Saver$|$)/].downcase.to_sym end
def default_options
def default_options # {} end
def implementation(symbol)
load "http/cookie_jar/*_saver" if not found. If loading fails,
Gets an implementation class by the name, optionally trying to
def implementation(symbol) @@class_map.fetch(symbol) rescue IndexError begin require 'http/cookie_jar/%s_saver' % symbol @@class_map.fetch(symbol) rescue LoadError, IndexError raise IndexError, 'cookie saver unavailable: %s' % symbol.inspect end end
def inherited(subclass) # :nodoc:
def inherited(subclass) # :nodoc: @@class_map[class_to_symbol(subclass)] = subclass end
def initialize(options = nil)
new(**options)
:call-seq:
def initialize(options = nil) options ||= {} @logger = options[:logger] @session = options[:session] # Initializes each instance variable of the same name as option # keyword. default_options.each_pair { |key, default| instance_variable_set("@#{key}", options.fetch(key, default)) } end
def load(io, jar)
Implements HTTP::CookieJar#load().
def load(io, jar) # self end
def save(io, jar)
Implements HTTP::CookieJar#save().
def save(io, jar) # self end