Class: ActionController::AllowBrowser::BrowserBlocker

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

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.



70
71
72
# File 'lib/action_controller/metal/allow_browser.rb', line 70

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

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



68
69
70
# File 'lib/action_controller/metal/allow_browser.rb', line 68

def request
  @request
end

#versionsObject (readonly)

Returns the value of attribute versions.



68
69
70
# File 'lib/action_controller/metal/allow_browser.rb', line 68

def versions
  @versions
end

Instance Method Details

#blocked?Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/action_controller/metal/allow_browser.rb', line 74

def blocked?
  user_agent_version_reported? && unsupported_browser?
end