Module: Galakei::Request
- Defined in:
- lib/galakei/request.rb
Instance Method Summary collapse
- #au? ⇒ Boolean
- #au_browser_6? ⇒ Boolean
- #different_cookie_in_ssl? ⇒ Boolean
- #docomo? ⇒ Boolean
- #galakei? ⇒ Boolean
- #galakei_uid ⇒ Object
- #imode_browser_1_0? ⇒ Boolean
- #softbank? ⇒ Boolean
Instance Method Details
#au? ⇒ Boolean
9 10 11 12 |
# File 'lib/galakei/request.rb', line 9 def au? # doesn't detect some 2G phones, but as they will be discontinued soon, doesn't really matter !! (/^KDDI-/ =~ user_agent) end |
#au_browser_6? ⇒ Boolean
26 27 28 |
# File 'lib/galakei/request.rb', line 26 def au_browser_6? /KDDI.* UP\.Browser\/6\./ =~ user_agent && /UP\.Browser\/6\.2_7/ !~ user_agent end |
#different_cookie_in_ssl? ⇒ Boolean
30 31 32 |
# File 'lib/galakei/request.rb', line 30 def au? || softbank? end |
#docomo? ⇒ Boolean
5 6 7 |
# File 'lib/galakei/request.rb', line 5 def docomo? !! (/^DoCoMo/ =~ user_agent) end |
#galakei? ⇒ Boolean
34 35 36 |
# File 'lib/galakei/request.rb', line 34 def galakei? docomo? || au? || softbank? end |
#galakei_uid ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/galakei/request.rb', line 38 def galakei_uid if docomo? env["HTTP_X_DCMGUID"] elsif au? env["HTTP_X_UP_SUBNO"] elsif softbank? env["HTTP_X_JPHONE_UID"] end end |
#imode_browser_1_0? ⇒ Boolean
18 19 20 21 22 23 24 |
# File 'lib/galakei/request.rb', line 18 def imode_browser_1_0? if /^DoCoMo(.*\((.*;)?c(\d+)\;)?/ =~ user_agent $3.to_i < 500 else false end end |
#softbank? ⇒ Boolean
14 15 16 |
# File 'lib/galakei/request.rb', line 14 def softbank? !! (/^(SoftBank|Vodafone)/ =~ user_agent) end |