Module: HTTP::Session::Options::Optionable

Included in:
CacheOption, CookiesOption, PersistentOption
Defined in:
lib/http/session/options/optionable.rb

Instance Method Summary collapse

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/http/session/options/optionable.rb', line 16

def enabled?
  @enabled
end

#initialize_options(opts) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/http/session/options/optionable.rb', line 4

def initialize_options(opts)
  @options =
    case opts
    when nil, false then {enabled: false}
    when true then {enabled: true}
    else opts
    end

  @enabled =
    @options.fetch(:enabled, true)
end