Module: Browser::Mobile

Included in:
Browser
Defined in:
lib/browser/methods/mobile.rb

Instance Method Summary collapse

Instance Method Details

#adobe_air?Boolean

Detect if browser is Adobe AIR.

Returns:

  • (Boolean)


19
20
21
# File 'lib/browser/methods/mobile.rb', line 19

def adobe_air?
  !!(ua =~ /adobeair/i)
end

#blackberry?Boolean

Detect if browser is BlackBerry

Returns:

  • (Boolean)


14
15
16
# File 'lib/browser/methods/mobile.rb', line 14

def blackberry?
  !!(ua =~ /(BlackBerry)/)
end

#mobile?Boolean

Detect if browser is mobile.

Returns:

  • (Boolean)


4
5
6
# File 'lib/browser/methods/mobile.rb', line 4

def mobile?
  detect_mobile? && !tablet?
end

#opera_mini?Boolean

Detect if browser is Opera Mini.

Returns:

  • (Boolean)


9
10
11
# File 'lib/browser/methods/mobile.rb', line 9

def opera_mini?
  !!(ua =~ /Opera Mini/)
end