Class: Jpmobile::Mobile::AbstractMobile
- Inherits:
-
Object
- Object
- Jpmobile::Mobile::AbstractMobile
- Defined in:
- lib/jpmobile/mobile/abstract_mobile.rb
Overview
?????????????????????????????????
Constant Summary
- USER_AGENT_REGEXP =
????????????user-agent???????????????
nil- MAIL_ADDRESS_REGEXP =
????????????????????????????????????????????????
nil
Class Method Summary (collapse)
-
+ (Boolean) valid_ip?(remote_addr)
?????????????????????IP??????????????????????????????????????????????????? true ???????????? ????????????????????? false ???????????? IP?????????????????????????????????????????? nil ????????????.
Instance Method Summary (collapse)
-
- (Object) display
??????????????? Display ??????????????????????????????????????????.
-
- (Object) ident
??????????????????????????????????????????????????????????????????.
-
- (Object) ident_device
???????????????????????????????????????????????????.
-
- (Object) ident_subscriber
??????????????????????????????????????????????????????.
-
- (AbstractMobile) initialize(request)
constructor
A new instance of AbstractMobile.
-
- (Object) position
???????????????????????? Position ?????????????????????????????????.
-
- (Boolean) supports_cookie?
?????????????????????????????????????????????.
- - (Boolean) valid_ip?
Constructor Details
- (AbstractMobile) initialize(request)
A new instance of AbstractMobile
6 7 8 |
# File 'lib/jpmobile/mobile/abstract_mobile.rb', line 6 def initialize(request) @request = request end |
Class Method Details
+ (Boolean) valid_ip?(remote_addr)
?????????????????????IP??????????????????????????????????????????????????? true ???????????? ????????????????????? false ???????????? IP?????????????????????????????????????????? nil ????????????
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jpmobile/mobile/abstract_mobile.rb', line 28 def self.valid_ip? remote_addr addrs = nil begin addrs = self::IP_ADDRESSES rescue NameError => e return nil end remote = IPAddr.new(remote_addr) addrs.any? {|ip| ip.include? remote } end |
Instance Method Details
- (Object) display
??????????????? Display ??????????????????????????????????????????
44 45 46 |
# File 'lib/jpmobile/mobile/abstract_mobile.rb', line 44 def display @__displlay ||= Jpmobile::Display.new end |
- (Object) ident
??????????????????????????????????????????????????????????????????
19 |
# File 'lib/jpmobile/mobile/abstract_mobile.rb', line 19 def ident; ident_subscriber || ident_device; end |
- (Object) ident_device
???????????????????????????????????????????????????
23 |
# File 'lib/jpmobile/mobile/abstract_mobile.rb', line 23 def ident_device; nil; end |
- (Object) ident_subscriber
??????????????????????????????????????????????????????
21 |
# File 'lib/jpmobile/mobile/abstract_mobile.rb', line 21 def ident_subscriber; nil; end |
- (Object) position
???????????????????????? Position ?????????????????????????????????
16 |
# File 'lib/jpmobile/mobile/abstract_mobile.rb', line 16 def position; return nil; end |
- (Boolean) supports_cookie?
?????????????????????????????????????????????
49 50 51 |
# File 'lib/jpmobile/mobile/abstract_mobile.rb', line 49 def return false end |
- (Boolean) valid_ip?
39 40 41 |
# File 'lib/jpmobile/mobile/abstract_mobile.rb', line 39 def valid_ip? @__valid_ip ||= self.class.valid_ip? @request.remote_addr end |