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 !
iモードIDを取得するメソッドを追加
darashi (author)
Wed Jul 02 00:41:33 -0700 2008
commit  709b5254ad3d8e911d59faa0235ea1292fdf2e3f
tree    92ef6171974016725f832161ae66740c3b61d8d3
parent  5edd1ac3fdbf636570db5a79dde65c9ba930a1a0
...
54
55
56
 
 
 
 
 
57
58
59
...
54
55
56
57
58
59
60
61
62
63
64
0
@@ -54,6 +54,11 @@ module Jpmobile::Mobile
0
     end
0
     alias :ident_subscriber :icc
0
 
0
+    # iモードIDを返す。
0
+    def guid
0
+      @request.env['HTTP_X_DCMGUID']
0
+    end
0
+
0
     # 画面情報を +Display+ クラスのインスタンスで返す。
0
     def display
0
       @__display ||= Jpmobile::Display.new(nil,nil,
...
1
2
3
 
4
5
6
...
12
13
14
 
 
 
 
 
 
 
 
 
 
 
...
1
2
 
3
4
5
6
...
12
13
14
15
16
17
18
19
20
21
22
23
24
25
0
@@ -1,6 +1,6 @@
0
 require File.dirname(__FILE__) + '/../spec_helper'
0
 
0
-describe "DoCoMo SH902i からのアクセス", :behaviour_type=>:controller do
0
+describe "DoCoMo SH902i からのアクセス" do
0
   before do
0
     request.user_agent = "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
0
   end
0
@@ -12,3 +12,14 @@ describe "DoCoMo SH902i からのアクセス", :behaviour_type=>:controller do
0
     request.mobile?.should be_true
0
   end
0
 end
0
+
0
+describe "DoCoMo SH902i からguid付きのアクセス" do
0
+  controller_name :mobile_spec
0
+  before do
0
+    request.user_agent = "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
0
+    request.env['HTTP_X_DCMGUID'] = "000000a"
0
+  end
0
+  it "guidを正しく取得できること" do
0
+    request.mobile.guid.should == "000000a"
0
+  end
0
+end

Comments