public
Description: A Rails plugin for Japanese mobile-phones
Homepage: http://jpmobile-rails.org
Clone URL: git://github.com/darashi/jpmobile.git
Click here to lend your support to: jpmobile and make a donation at www.pledgie.com !
commit  ad831a4acbdb44d0676a6e7c742c3f410134d9a9
tree    fabfb48d1c9f1db06843867596e95aec170a54e5
parent  f88891cd90311e7ed0b9b6f5570c7546d6da7f50
...
52
53
54
55
56
57
58
59
60
61
 
 
 
 
 
62
63
64
...
52
53
54
 
55
56
57
58
59
60
61
62
63
64
65
66
67
68
0
@@ -52,13 +52,17 @@ module Jpmobile::Mobile
0
       @request.env['HTTP_USER_AGENT'] =~ /icc([0-9a-zA-Z]{20})\)/
0
       return $1
0
     end
0
-    alias :ident_subscriber :icc
0
 
0
     # iモードIDを返す。
0
     def guid
0
       @request.env['HTTP_X_DCMGUID']
0
     end
0
 
0
+    # iモードID, FOMAカード製造番号の順で調べ、あるものを返す。なければ +nil+ を返す。
0
+    def ident_subscriber
0
+      guid || icc
0
+    end
0
+
0
     # 画面情報を +Display+ クラスのインスタンスで返す。
0
     def display
0
       @__display ||= Jpmobile::Display.new(nil,nil,
...
22
23
24
 
 
 
25
...
22
23
24
25
26
27
28
0
@@ -22,4 +22,7 @@ describe "DoCoMo SH902i からguid付きのアクセス" do
0
   it "guidを正しく取得できること" do
0
     request.mobile.guid.should == "000000a"
0
   end
0
+  it "ident_subscriberでも正しく取得できること" do
0
+    request.mobile.ident_subscriber.should == "000000a"
0
+  end
0
 end

Comments