Module: Browser::Consoles
- Included in:
- Browser
- Defined in:
- lib/browser/methods/consoles.rb
Instance Method Summary collapse
-
#console? ⇒ Boolean
Detect if browser is console (currently Xbox, PlayStation, or Nintendo).
-
#nintendo? ⇒ Boolean
Detect if browser is Nintendo.
-
#playstation? ⇒ Boolean
Detect if browser is PlayStation.
-
#psp? ⇒ Boolean
Detect if browser is running from PSP.
-
#xbox? ⇒ Boolean
Detect if browser is Xbox.
Instance Method Details
#console? ⇒ Boolean
Detect if browser is console (currently Xbox, PlayStation, or Nintendo).
19 20 21 |
# File 'lib/browser/methods/consoles.rb', line 19 def console? xbox? || playstation? || nintendo? end |
#nintendo? ⇒ Boolean
Detect if browser is Nintendo.
14 15 16 |
# File 'lib/browser/methods/consoles.rb', line 14 def nintendo? !!(ua =~ /nintendo/i) end |
#playstation? ⇒ Boolean
Detect if browser is PlayStation.
9 10 11 |
# File 'lib/browser/methods/consoles.rb', line 9 def playstation? !!(ua =~ /playstation/i) end |
#psp? ⇒ Boolean
Detect if browser is running from PSP.
24 25 26 |
# File 'lib/browser/methods/consoles.rb', line 24 def psp? !!(ua =~ /(PSP|Playstation Vita)/) end |
#xbox? ⇒ Boolean
Detect if browser is Xbox.
4 5 6 |
# File 'lib/browser/methods/consoles.rb', line 4 def xbox? !!(ua =~ /xbox/i) end |