Class: Rack::Ketai::Carrier::IPhone

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

Constant Summary collapse

USER_AGENT_REGEXP =
/iPhone|iPod|iPad/

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/iphone.rb', line 14

def smartphone?
  super && !tablet?
end

#supports_cookie?Boolean

Returns:

  • (Boolean)


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

def supports_cookie?
  true
end

#tablet?Boolean

Returns:

  • (Boolean)


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

def tablet?
  @env['HTTP_USER_AGENT'].to_s =~ /iPad/
end