Class: RailsSameSiteCookie::UserAgentChecker
- Inherits:
-
Object
- Object
- RailsSameSiteCookie::UserAgentChecker
- Defined in:
- lib/rails_same_site_cookie/user_agent_checker.rb
Constant Summary collapse
- PARSER =
UserAgentParser::Parser.new
Instance Attribute Summary collapse
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
- #chrome? ⇒ Boolean
-
#initialize(user_agent = nil) ⇒ UserAgentChecker
constructor
A new instance of UserAgentChecker.
- #send_same_site_none? ⇒ Boolean
Constructor Details
#initialize(user_agent = nil) ⇒ UserAgentChecker
Returns a new instance of UserAgentChecker.
14 15 16 17 |
# File 'lib/rails_same_site_cookie/user_agent_checker.rb', line 14 def initialize(user_agent=nil) @user_agent_str = user_agent @user_agent = PARSER.parse(user_agent) if user_agent end |
Instance Attribute Details
#user_agent ⇒ Object
Returns the value of attribute user_agent.
7 8 9 |
# File 'lib/rails_same_site_cookie/user_agent_checker.rb', line 7 def user_agent @user_agent end |
Instance Method Details
#chrome? ⇒ Boolean
24 25 26 |
# File 'lib/rails_same_site_cookie/user_agent_checker.rb', line 24 def chrome? is_chromium_based? end |
#send_same_site_none? ⇒ Boolean
19 20 21 22 |
# File 'lib/rails_same_site_cookie/user_agent_checker.rb', line 19 def send_same_site_none? return true if user_agent.nil? or @user_agent_str == '' return !missing_same_site_none_support? end |