Sha256: f9f2e653fb982167ce853cb280825eb46bca97f4b5cdba2b4a31a4cee09d2f3e
Contents?: true
Size: 459 Bytes
Versions: 2
Compression:
Stored size: 459 Bytes
Contents
class Browser module Mobile # Detect if browser is mobile. def mobile? detect_mobile? && !tablet? end # Detect if browser is Opera Mini. def opera_mini? !!(ua =~ /Opera Mini/) end # Detect if browser is BlackBerry def blackberry? !!(ua =~ /(BlackBerry)/) end private def detect_mobile? ua =~ /(Mobi(le)?|Symbian|MIDP|Windows CE)/ || blackberry? || psp? || opera_mini? end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
browser-0.4.1 | lib/browser/methods/mobile.rb |
browser-0.4.0 | lib/browser/methods/mobile.rb |