Module: Rack::SimpleUserAgent::Detectors::Smartphone
- Included in:
- Rack::SimpleUserAgent::Detectors
- Defined in:
- lib/rack/simple_user_agent/detectors/smartphone.rb
Instance Method Summary collapse
- #from_android? ⇒ Boolean
- #from_android_mobile? ⇒ Boolean
- #from_android_tablet? ⇒ Boolean
- #from_ios? ⇒ Boolean
- #from_ipad? ⇒ Boolean
- #from_iphone? ⇒ Boolean
- #from_ipod? ⇒ Boolean
- #from_smartphone? ⇒ Boolean
- #from_windows_phone? ⇒ Boolean
Instance Method Details
#from_android? ⇒ Boolean
25 26 27 |
# File 'lib/rack/simple_user_agent/detectors/smartphone.rb', line 25 def from_android? user_agent_string.include?("Android") end |
#from_android_mobile? ⇒ Boolean
33 34 35 |
# File 'lib/rack/simple_user_agent/detectors/smartphone.rb', line 33 def from_android_mobile? from_android? && android_mobile? end |
#from_android_tablet? ⇒ Boolean
29 30 31 |
# File 'lib/rack/simple_user_agent/detectors/smartphone.rb', line 29 def from_android_tablet? from_android? && !android_mobile? end |
#from_ios? ⇒ Boolean
9 10 11 |
# File 'lib/rack/simple_user_agent/detectors/smartphone.rb', line 9 def from_ios? from_iphone? || from_ipad? || from_ipod? end |
#from_ipad? ⇒ Boolean
17 18 19 |
# File 'lib/rack/simple_user_agent/detectors/smartphone.rb', line 17 def from_ipad? user_agent_string.include?("iPad") end |
#from_iphone? ⇒ Boolean
13 14 15 |
# File 'lib/rack/simple_user_agent/detectors/smartphone.rb', line 13 def from_iphone? user_agent_string.include?("iPhone") end |
#from_ipod? ⇒ Boolean
21 22 23 |
# File 'lib/rack/simple_user_agent/detectors/smartphone.rb', line 21 def from_ipod? user_agent_string.include?("iPod") end |
#from_smartphone? ⇒ Boolean
5 6 7 |
# File 'lib/rack/simple_user_agent/detectors/smartphone.rb', line 5 def from_smartphone? from_ios? || from_android? || from_windows_phone? end |
#from_windows_phone? ⇒ Boolean
37 38 39 |
# File 'lib/rack/simple_user_agent/detectors/smartphone.rb', line 37 def from_windows_phone? user_agent_string.include?("Windows Phone") end |