Class: Rack::Ketai::Carrier::Android

Inherits:
Smartphone show all
Defined in:
lib/rack/ketai/carrier/android.rb

Constant Summary collapse

USER_AGENT_REGEXP =
/Android/

Constants inherited from Smartphone

Smartphone::CIDRS

Instance Method Summary collapse

Methods inherited from Smartphone

#mobile?

Methods inherited from General

filters

Methods inherited from Abstract

#cache_size, #deviceid, #display, #featurephone?, #filtering, filters, #filters, #ident, #initialize, #mobile?, #name, #position, #request, #subscriberid, valid_addr?, #valid_addr?, valid_ip?

Constructor Details

This class inherits a constructor from Rack::Ketai::Carrier::Abstract

Instance Method Details

#smartphone?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/rack/ketai/carrier/android.rb', line 14

def smartphone?
  super && !tablet?
end

#supports_cookie?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/rack/ketai/carrier/android.rb', line 10

def supports_cookie?
  true
end

#tablet?Boolean

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/rack/ketai/carrier/android.rb', line 18

def tablet?
  @env['HTTP_USER_AGENT'].to_s !~ /Mobile/ ||
    @env['HTTP_USER_AGENT'].to_s =~ /SC-01C/
end