Class: Tuttle::Presenters::RackMiniProfiler::ClientSettings

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/tuttle/presenters/rack_mini_profiler/client_settings.rb

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ ClientSettings

Returns a new instance of ClientSettings.



7
8
9
10
11
# File 'lib/tuttle/presenters/rack_mini_profiler/client_settings.rb', line 7

def initialize(env)
  rmp_cs_args = [env]
  rmp_cs_args += [::Rack::MiniProfiler.config.storage_instance, Time.current] if version_10?
  super(::Rack::MiniProfiler::ClientSettings.new(*rmp_cs_args))
end

Instance Method Details



17
18
19
# File 'lib/tuttle/presenters/rack_mini_profiler/client_settings.rb', line 17

def tuttle_check_cookie
  version_10? ? has_valid_cookie? : has_cookie?
end


21
22
23
# File 'lib/tuttle/presenters/rack_mini_profiler/client_settings.rb', line 21

def tuttle_check_cookie_method
  version_10? ? 'has_valid_cookie?' : 'has_cookie?'
end

#version_10?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/tuttle/presenters/rack_mini_profiler/client_settings.rb', line 13

def version_10?
  Rack::MiniProfiler::ClientSettings.instance_method(:initialize).arity > 1
end