Class: SupportSegment::MobileDetect::Constraint

Inherits:
Object
  • Object
show all
Defined in:
lib/support_segment/mobile_detect.rb

Instance Method Summary collapse

Instance Method Details

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
# File 'lib/support_segment/mobile_detect.rb', line 5

def matches?(request)
  return false if request.cookies[:full_site_form_mobile] || request.host.match(/^m./)
  request.user_agent.to_s.match(/Mobile/)
end