Class: ActionController::AllowBrowser::BrowserBlocker

Inherits:
Object
  • Object
show all
Defined in:
lib/action_controller/metal/allow_browser.rb

Overview

:nodoc:

Constant Summary collapse

SETS =
{
  modern: { safari: 17.2, chrome: 120, firefox: 121, opera: 106, ie: false }
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request, versions:) ⇒ BrowserBlocker

Returns a new instance of BrowserBlocker.



80
81
82
# File 'lib/action_controller/metal/allow_browser.rb', line 80

def initialize(request, versions:)
  @request, @versions = request, versions
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



78
79
80
# File 'lib/action_controller/metal/allow_browser.rb', line 78

def request
  @request
end

#versionsObject (readonly)

Returns the value of attribute versions.



78
79
80
# File 'lib/action_controller/metal/allow_browser.rb', line 78

def versions
  @versions
end

Instance Method Details

#blocked?Boolean

Returns:

  • (Boolean)


84
85
86
# File 'lib/action_controller/metal/allow_browser.rb', line 84

def blocked?
  user_agent_version_reported? && unsupported_browser?
end