jpmobile 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README +32 -10
- data/Rakefile +8 -8
- data/doc/classes/ActionController.html +120 -0
- data/doc/classes/ActionController/AbstractRequest.html +118 -0
- data/doc/classes/ActionController/CgiRequest.html +160 -0
- data/doc/classes/ActionView.html +101 -0
- data/doc/classes/DatumConv.html +324 -0
- data/doc/classes/Jpmobile/Display.html +333 -0
- data/doc/classes/Jpmobile/Emoticon.html +467 -0
- data/doc/classes/Jpmobile/Filter.html +120 -0
- data/doc/classes/Jpmobile/Filter/ApplyOnlyForMobile.html +172 -0
- data/doc/classes/Jpmobile/Filter/Base.html +269 -0
- data/doc/classes/Jpmobile/Filter/Emoticon.html +118 -0
- data/doc/classes/Jpmobile/Filter/Emoticon/Inner.html +184 -0
- data/doc/classes/Jpmobile/Filter/Emoticon/Outer.html +207 -0
- data/doc/classes/Jpmobile/Filter/FilterTable.html +178 -0
- data/doc/classes/Jpmobile/Filter/HankakuKana.html +126 -0
- data/doc/classes/Jpmobile/Filter/Sjis.html +271 -0
- data/doc/classes/Jpmobile/Helpers.html +588 -0
- data/doc/classes/Jpmobile/Mobile.html +150 -0
- data/doc/classes/Jpmobile/Mobile/AbstractMobile.html +389 -0
- data/doc/classes/Jpmobile/Mobile/Au.html +420 -0
- data/doc/classes/Jpmobile/Mobile/Ddipocket.html +138 -0
- data/doc/classes/Jpmobile/Mobile/Docomo.html +411 -0
- data/doc/classes/Jpmobile/Mobile/Emobile.html +183 -0
- data/doc/classes/Jpmobile/Mobile/Jphone.html +212 -0
- data/doc/classes/Jpmobile/Mobile/Softbank.html +344 -0
- data/doc/classes/Jpmobile/Mobile/Vodafone.html +176 -0
- data/doc/classes/Jpmobile/Mobile/Willcom.html +211 -0
- data/doc/classes/Jpmobile/Position.html +384 -0
- data/doc/classes/Jpmobile/RequestWithMobile.html +263 -0
- data/doc/created.rid +1 -0
- data/doc/files/CHANGELOG.html +110 -0
- data/doc/files/README.html +455 -0
- data/doc/files/lib/jpmobile/datum_conv_rb.html +110 -0
- data/doc/files/lib/jpmobile/emoticon/au_rb.html +124 -0
- data/doc/files/lib/jpmobile/emoticon/conversion_table_rb.html +124 -0
- data/doc/files/lib/jpmobile/emoticon/docomo_rb.html +119 -0
- data/doc/files/lib/jpmobile/emoticon/softbank_rb.html +119 -0
- data/doc/files/lib/jpmobile/emoticon/z_combine_rb.html +101 -0
- data/doc/files/lib/jpmobile/emoticon_rb.html +101 -0
- data/doc/files/lib/jpmobile/filter_rb.html +115 -0
- data/doc/files/lib/jpmobile/helpers_rb.html +105 -0
- data/doc/files/lib/jpmobile/hook_abstract_request_rb.html +108 -0
- data/doc/files/lib/jpmobile/hook_action_controller_rb.html +101 -0
- data/doc/files/lib/jpmobile/hook_action_view_rb.html +110 -0
- data/doc/files/lib/jpmobile/mobile/abstract_mobile_rb.html +108 -0
- data/doc/files/lib/jpmobile/mobile/au_rb.html +112 -0
- data/doc/files/lib/jpmobile/mobile/display_rb.html +111 -0
- data/doc/files/lib/jpmobile/mobile/docomo_rb.html +105 -0
- data/doc/files/lib/jpmobile/mobile/emobile_rb.html +105 -0
- data/doc/files/lib/jpmobile/mobile/softbank_rb.html +115 -0
- data/doc/files/lib/jpmobile/mobile/willcom_rb.html +108 -0
- data/doc/files/lib/jpmobile/mobile/z_display_info_docomo_rb.html +114 -0
- data/doc/files/lib/jpmobile/mobile/z_ip_addresses_au_rb.html +114 -0
- data/doc/files/lib/jpmobile/mobile/z_ip_addresses_docomo_rb.html +124 -0
- data/doc/files/lib/jpmobile/mobile/z_ip_addresses_emobile_rb.html +111 -0
- data/doc/files/lib/jpmobile/mobile/z_ip_addresses_softbank_rb.html +124 -0
- data/doc/files/lib/jpmobile/mobile/z_ip_addresses_willcom_rb.html +114 -0
- data/doc/files/lib/jpmobile/position_rb.html +105 -0
- data/doc/files/lib/jpmobile/request_with_mobile_rb.html +111 -0
- data/doc/files/lib/jpmobile/trans_sid_rb.html +118 -0
- data/doc/files/lib/jpmobile/version_rb.html +101 -0
- data/doc/files/lib/jpmobile_rb.html +101 -0
- data/doc/fr_class_index.html +55 -0
- data/doc/fr_file_index.html +58 -0
- data/doc/fr_method_index.html +134 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/jpmobile.rb +32 -1
- data/lib/jpmobile/emoticon.rb +18 -0
- data/lib/jpmobile/emoticon/au.rb +643 -0
- data/lib/jpmobile/filter.rb +5 -1
- data/lib/jpmobile/helpers.rb +9 -1
- data/lib/jpmobile/hook_abstract_request.rb +3 -24
- data/lib/jpmobile/hook_action_controller.rb +2 -2
- data/lib/jpmobile/hook_action_view.rb +41 -8
- data/lib/jpmobile/mobile/abstract_mobile.rb +18 -12
- data/lib/jpmobile/mobile/au.rb +11 -5
- data/lib/jpmobile/mobile/docomo.rb +27 -11
- data/lib/jpmobile/mobile/emobile.rb +15 -0
- data/lib/jpmobile/mobile/softbank.rb +11 -7
- data/lib/jpmobile/mobile/willcom.rb +5 -2
- data/lib/jpmobile/mobile/z_display_info_docomo.rb +343 -219
- data/lib/jpmobile/mobile/z_ip_addresses_au.rb +4 -1
- data/lib/jpmobile/mobile/z_ip_addresses_docomo.rb +10 -0
- data/lib/jpmobile/mobile/z_ip_addresses_emobile.rb +10 -0
- data/lib/jpmobile/mobile/{z_ip_addresses.rb → z_ip_addresses_softbank.rb} +2 -13
- data/lib/jpmobile/mobile/z_ip_addresses_willcom.rb +20 -1
- data/lib/jpmobile/position.rb +2 -2
- data/lib/jpmobile/request_with_mobile.rb +44 -0
- data/lib/jpmobile/trans_sid.rb +52 -14
- data/lib/jpmobile/version.rb +1 -1
- data/test/au_test.rb +94 -63
- data/test/autoload_test.rb +49 -0
- data/test/docomo_test.rb +92 -59
- data/test/emoticon_functional_test.rb +30 -3
- data/test/filter_test.rb +0 -64
- data/test/helper.rb +8 -1
- data/test/helpers_test.rb +14 -13
- data/test/softbank_test.rb +113 -85
- data/test/willcom_test.rb +30 -20
- data/tools/generate_au_emoticon_table.rb +12 -3
- data/tools/update_display_info_docomo.rb +0 -0
- data/tools/update_ip_addresses_au.rb +1 -1
- data/tools/update_ip_addresses_willcom.rb +1 -1
- metadata +135 -54
- data/test/filter_functional_test.rb +0 -146
@@ -0,0 +1,212 @@
|
|
1
|
+
<?xml version="1.0" encoding=" UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Jpmobile::Mobile::Jphone</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset= UTF-8" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Jpmobile::Mobile::Jphone</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/jpmobile/mobile/softbank_rb.html">
|
59
|
+
lib/jpmobile/mobile/softbank.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="Vodafone.html">
|
69
|
+
Vodafone
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
<div id="description">
|
84
|
+
<h2>SoftBank 2G携帯電話(J-PHONE/<a href="Vodafone.html">Vodafone</a> 2G)</h2>
|
85
|
+
<p>
|
86
|
+
スーパクラスは<a href="Vodafone.html">Vodafone</a>。
|
87
|
+
</p>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
<div id="method-list">
|
95
|
+
<h3 class="section-bar">Methods</h3>
|
96
|
+
|
97
|
+
<div class="name-list">
|
98
|
+
<a href="#M000024">position</a>
|
99
|
+
<a href="#M000025">supports_cookie?</a>
|
100
|
+
</div>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
</div>
|
104
|
+
|
105
|
+
|
106
|
+
<!-- if includes -->
|
107
|
+
|
108
|
+
<div id="section">
|
109
|
+
|
110
|
+
|
111
|
+
<div id="constants-list">
|
112
|
+
<h3 class="section-bar">Constants</h3>
|
113
|
+
|
114
|
+
<div class="name-list">
|
115
|
+
<table summary="Constants">
|
116
|
+
<tr class="top-aligned-row context-row">
|
117
|
+
<td class="context-item-name">USER_AGENT_REGEXP</td>
|
118
|
+
<td>=</td>
|
119
|
+
<td class="context-item-value">/^(J-PHONE|J-EMULATOR)/</td>
|
120
|
+
<td width="3em"> </td>
|
121
|
+
<td class="context-item-desc">
|
122
|
+
対応するUser-Agentの正規表現
|
123
|
+
|
124
|
+
</td>
|
125
|
+
</tr>
|
126
|
+
</table>
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<!-- if method_list -->
|
136
|
+
<div id="methods">
|
137
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
138
|
+
|
139
|
+
<div id="method-M000024" class="method-detail">
|
140
|
+
<a name="M000024"></a>
|
141
|
+
|
142
|
+
<div class="method-heading">
|
143
|
+
<a href="#M000024" class="method-signature">
|
144
|
+
<span class="method-name">position</span><span class="method-args">()</span>
|
145
|
+
</a>
|
146
|
+
</div>
|
147
|
+
|
148
|
+
<div class="method-description">
|
149
|
+
<p>
|
150
|
+
位置情報があれば <a href="../Position.html">Position</a>
|
151
|
+
のインスタンスを返す。無ければ <tt>nil</tt> を返す。
|
152
|
+
</p>
|
153
|
+
<p><a class="source-toggle" href="#"
|
154
|
+
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
155
|
+
<div class="method-source-code" id="M000024-source">
|
156
|
+
<pre>
|
157
|
+
<span class="ruby-comment cmt"># File lib/jpmobile/mobile/softbank.rb, line 87</span>
|
158
|
+
87: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">position</span>
|
159
|
+
88: <span class="ruby-identifier">str</span> = <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">"HTTP_X_JPHONE_GEOCODE"</span>]
|
160
|
+
89: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">str</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"0000000%1A0000000%1A%88%CA%92%75%8F%EE%95%F1%82%C8%82%B5"</span>
|
161
|
+
90: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"unsuppoted format"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">str</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^(\d\d)(\d\d)(\d\d)%1A(\d\d\d)(\d\d)(\d\d)%1A(.+)$/</span>
|
162
|
+
91: <span class="ruby-identifier">pos</span> = <span class="ruby-constant">Jpmobile</span><span class="ruby-operator">::</span><span class="ruby-constant">Position</span>.<span class="ruby-identifier">new</span>
|
163
|
+
92: <span class="ruby-identifier">pos</span>.<span class="ruby-identifier">lat</span> = <span class="ruby-constant">Jpmobile</span><span class="ruby-operator">::</span><span class="ruby-constant">Position</span>.<span class="ruby-identifier">dms2deg</span>(<span class="ruby-identifier">$1</span>,<span class="ruby-identifier">$2</span>,<span class="ruby-identifier">$3</span>)
|
164
|
+
93: <span class="ruby-identifier">pos</span>.<span class="ruby-identifier">lon</span> = <span class="ruby-constant">Jpmobile</span><span class="ruby-operator">::</span><span class="ruby-constant">Position</span>.<span class="ruby-identifier">dms2deg</span>(<span class="ruby-identifier">$4</span>,<span class="ruby-identifier">$5</span>,<span class="ruby-identifier">$6</span>)
|
165
|
+
94: <span class="ruby-identifier">pos</span>.<span class="ruby-identifier">options</span> = {<span class="ruby-value str">"address"</span>=<span class="ruby-operator">></span><span class="ruby-constant">CGI</span>.<span class="ruby-identifier">unescape</span>(<span class="ruby-identifier">$7</span>).<span class="ruby-identifier">toutf8</span>}
|
166
|
+
95: <span class="ruby-identifier">pos</span>.<span class="ruby-identifier">tokyo2wgs84!</span>
|
167
|
+
96: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">pos</span>
|
168
|
+
97: <span class="ruby-keyword kw">end</span>
|
169
|
+
</pre>
|
170
|
+
</div>
|
171
|
+
</div>
|
172
|
+
</div>
|
173
|
+
|
174
|
+
<div id="method-M000025" class="method-detail">
|
175
|
+
<a name="M000025"></a>
|
176
|
+
|
177
|
+
<div class="method-heading">
|
178
|
+
<a href="#M000025" class="method-signature">
|
179
|
+
<span class="method-name">supports_cookie?</span><span class="method-args">()</span>
|
180
|
+
</a>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
<div class="method-description">
|
184
|
+
<p>
|
185
|
+
cookieに対応しているか?
|
186
|
+
</p>
|
187
|
+
<p><a class="source-toggle" href="#"
|
188
|
+
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
189
|
+
<div class="method-source-code" id="M000025-source">
|
190
|
+
<pre>
|
191
|
+
<span class="ruby-comment cmt"># File lib/jpmobile/mobile/softbank.rb, line 100</span>
|
192
|
+
100: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">supports_cookie?</span>
|
193
|
+
101: <span class="ruby-keyword kw">false</span>
|
194
|
+
102: <span class="ruby-keyword kw">end</span>
|
195
|
+
</pre>
|
196
|
+
</div>
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
|
201
|
+
</div>
|
202
|
+
|
203
|
+
|
204
|
+
</div>
|
205
|
+
|
206
|
+
|
207
|
+
<div id="validator-badges">
|
208
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
209
|
+
</div>
|
210
|
+
|
211
|
+
</body>
|
212
|
+
</html>
|
@@ -0,0 +1,344 @@
|
|
1
|
+
<?xml version="1.0" encoding=" UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Jpmobile::Mobile::Softbank</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset= UTF-8" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Jpmobile::Mobile::Softbank</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/jpmobile/mobile/softbank_rb.html">
|
59
|
+
lib/jpmobile/mobile/softbank.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="AbstractMobile.html">
|
69
|
+
AbstractMobile
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
<div id="description">
|
84
|
+
<h2><a href="Softbank.html">Softbank</a>携帯電話</h2>
|
85
|
+
<p>
|
86
|
+
<a href="Vodafone.html">Vodafone</a>, <a
|
87
|
+
href="Jphone.html">Jphone</a>のスーパクラス。
|
88
|
+
</p>
|
89
|
+
|
90
|
+
</div>
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div id="method-list">
|
96
|
+
<h3 class="section-bar">Methods</h3>
|
97
|
+
|
98
|
+
<div class="name-list">
|
99
|
+
<a href="#M000031">display</a>
|
100
|
+
<a href="#M000027">ident_device</a>
|
101
|
+
<a href="#M000029">ident_subscriber</a>
|
102
|
+
<a href="#M000030">position</a>
|
103
|
+
<a href="#M000026">serial_number</a>
|
104
|
+
<a href="#M000032">supports_cookie?</a>
|
105
|
+
<a href="#M000028">x_jphone_uid</a>
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
<!-- if includes -->
|
113
|
+
|
114
|
+
<div id="section">
|
115
|
+
|
116
|
+
|
117
|
+
<div id="constants-list">
|
118
|
+
<h3 class="section-bar">Constants</h3>
|
119
|
+
|
120
|
+
<div class="name-list">
|
121
|
+
<table summary="Constants">
|
122
|
+
<tr class="top-aligned-row context-row">
|
123
|
+
<td class="context-item-name">USER_AGENT_REGEXP</td>
|
124
|
+
<td>=</td>
|
125
|
+
<td class="context-item-value">/^(SoftBank|Semulator)/</td>
|
126
|
+
<td width="3em"> </td>
|
127
|
+
<td class="context-item-desc">
|
128
|
+
対応するuser-agentの正規表現
|
129
|
+
|
130
|
+
</td>
|
131
|
+
</tr>
|
132
|
+
</table>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
<!-- if method_list -->
|
142
|
+
<div id="methods">
|
143
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
144
|
+
|
145
|
+
<div id="method-M000031" class="method-detail">
|
146
|
+
<a name="M000031"></a>
|
147
|
+
|
148
|
+
<div class="method-heading">
|
149
|
+
<a href="#M000031" class="method-signature">
|
150
|
+
<span class="method-name">display</span><span class="method-args">()</span>
|
151
|
+
</a>
|
152
|
+
</div>
|
153
|
+
|
154
|
+
<div class="method-description">
|
155
|
+
<p>
|
156
|
+
画面情報を <tt><a href="../Display.html">Display</a></tt>
|
157
|
+
クラスのインスタンスで返す。
|
158
|
+
</p>
|
159
|
+
<p><a class="source-toggle" href="#"
|
160
|
+
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
161
|
+
<div class="method-source-code" id="M000031-source">
|
162
|
+
<pre>
|
163
|
+
<span class="ruby-comment cmt"># File lib/jpmobile/mobile/softbank.rb, line 44</span>
|
164
|
+
44: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">display</span>
|
165
|
+
45: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@__display</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@__display</span>
|
166
|
+
46: <span class="ruby-identifier">p_w</span> = <span class="ruby-identifier">p_h</span> = <span class="ruby-identifier">col_p</span> = <span class="ruby-identifier">cols</span> = <span class="ruby-keyword kw">nil</span>
|
167
|
+
47: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">r</span> = <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">'HTTP_X_JPHONE_DISPLAY'</span>]
|
168
|
+
48: <span class="ruby-identifier">p_w</span>, <span class="ruby-identifier">p_h</span> = <span class="ruby-identifier">r</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/\*/</span>,<span class="ruby-value">2</span>).<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">to_i</span>}
|
169
|
+
49: <span class="ruby-keyword kw">end</span>
|
170
|
+
50: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">r</span> = <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">'HTTP_X_JPHONE_COLOR'</span>]
|
171
|
+
51: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">r</span>
|
172
|
+
52: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^C/</span>
|
173
|
+
53: <span class="ruby-identifier">col_p</span> = <span class="ruby-keyword kw">true</span>
|
174
|
+
54: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^G/</span>
|
175
|
+
55: <span class="ruby-identifier">col_p</span> = <span class="ruby-keyword kw">false</span>
|
176
|
+
56: <span class="ruby-keyword kw">end</span>
|
177
|
+
57: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">r</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^.(\d+)$/</span>
|
178
|
+
58: <span class="ruby-identifier">cols</span> = <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">to_i</span>
|
179
|
+
59: <span class="ruby-keyword kw">end</span>
|
180
|
+
60: <span class="ruby-keyword kw">end</span>
|
181
|
+
61: <span class="ruby-ivar">@__display</span> = <span class="ruby-constant">Jpmobile</span><span class="ruby-operator">::</span><span class="ruby-constant">Display</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">p_w</span>, <span class="ruby-identifier">p_h</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">col_p</span>, <span class="ruby-identifier">cols</span>)
|
182
|
+
62: <span class="ruby-keyword kw">end</span>
|
183
|
+
</pre>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div id="method-M000027" class="method-detail">
|
189
|
+
<a name="M000027"></a>
|
190
|
+
|
191
|
+
<div class="method-heading">
|
192
|
+
<span class="method-name">ident_device</span><span class="method-args">()</span>
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<div class="method-description">
|
196
|
+
<p>
|
197
|
+
Alias for <a href="Softbank.html#M000026">serial_number</a>
|
198
|
+
</p>
|
199
|
+
</div>
|
200
|
+
</div>
|
201
|
+
|
202
|
+
<div id="method-M000029" class="method-detail">
|
203
|
+
<a name="M000029"></a>
|
204
|
+
|
205
|
+
<div class="method-heading">
|
206
|
+
<span class="method-name">ident_subscriber</span><span class="method-args">()</span>
|
207
|
+
</div>
|
208
|
+
|
209
|
+
<div class="method-description">
|
210
|
+
<p>
|
211
|
+
Alias for <a href="Softbank.html#M000028">x_jphone_uid</a>
|
212
|
+
</p>
|
213
|
+
</div>
|
214
|
+
</div>
|
215
|
+
|
216
|
+
<div id="method-M000030" class="method-detail">
|
217
|
+
<a name="M000030"></a>
|
218
|
+
|
219
|
+
<div class="method-heading">
|
220
|
+
<a href="#M000030" class="method-signature">
|
221
|
+
<span class="method-name">position</span><span class="method-args">()</span>
|
222
|
+
</a>
|
223
|
+
</div>
|
224
|
+
|
225
|
+
<div class="method-description">
|
226
|
+
<p>
|
227
|
+
位置情報があれば <a href="../Position.html">Position</a>
|
228
|
+
のインスタンスを返す。無ければ <tt>nil</tt> を返す。
|
229
|
+
</p>
|
230
|
+
<p><a class="source-toggle" href="#"
|
231
|
+
onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
|
232
|
+
<div class="method-source-code" id="M000030-source">
|
233
|
+
<pre>
|
234
|
+
<span class="ruby-comment cmt"># File lib/jpmobile/mobile/softbank.rb, line 29</span>
|
235
|
+
29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">position</span>
|
236
|
+
30: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@__position</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span> <span class="ruby-ivar">@__position</span>
|
237
|
+
31: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value str">"pos"</span>] <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^([NS])(\d+)\.(\d+)\.(\d+\.\d+)([WE])(\d+)\.(\d+)\.(\d+\.\d+)$/</span>
|
238
|
+
32: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Unsupported datum"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value str">"geo"</span>] <span class="ruby-operator">!=</span> <span class="ruby-value str">"wgs84"</span>
|
239
|
+
33: <span class="ruby-identifier">l</span> = <span class="ruby-constant">Jpmobile</span><span class="ruby-operator">::</span><span class="ruby-constant">Position</span>.<span class="ruby-identifier">new</span>
|
240
|
+
34: <span class="ruby-identifier">l</span>.<span class="ruby-identifier">lat</span> = (<span class="ruby-identifier">$1</span><span class="ruby-operator">==</span><span class="ruby-value str">"N"</span> <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">-1</span>) <span class="ruby-operator">*</span> <span class="ruby-constant">Jpmobile</span><span class="ruby-operator">::</span><span class="ruby-constant">Position</span>.<span class="ruby-identifier">dms2deg</span>(<span class="ruby-identifier">$2</span>,<span class="ruby-identifier">$3</span>,<span class="ruby-identifier">$4</span>)
|
241
|
+
35: <span class="ruby-identifier">l</span>.<span class="ruby-identifier">lon</span> = (<span class="ruby-identifier">$5</span><span class="ruby-operator">==</span><span class="ruby-value str">"E"</span> <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">-1</span>) <span class="ruby-operator">*</span> <span class="ruby-constant">Jpmobile</span><span class="ruby-operator">::</span><span class="ruby-constant">Position</span>.<span class="ruby-identifier">dms2deg</span>(<span class="ruby-identifier">$6</span>,<span class="ruby-identifier">$7</span>,<span class="ruby-identifier">$8</span>)
|
242
|
+
36: <span class="ruby-identifier">l</span>.<span class="ruby-identifier">options</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span>[<span class="ruby-value str">"pos"</span>,<span class="ruby-value str">"geo"</span>,<span class="ruby-value str">"x-acr"</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">x</span>) }
|
243
|
+
37: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@__position</span> = <span class="ruby-identifier">l</span>
|
244
|
+
38: <span class="ruby-keyword kw">else</span>
|
245
|
+
39: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@__position</span> = <span class="ruby-keyword kw">nil</span>
|
246
|
+
40: <span class="ruby-keyword kw">end</span>
|
247
|
+
41: <span class="ruby-keyword kw">end</span>
|
248
|
+
</pre>
|
249
|
+
</div>
|
250
|
+
</div>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<div id="method-M000026" class="method-detail">
|
254
|
+
<a name="M000026"></a>
|
255
|
+
|
256
|
+
<div class="method-heading">
|
257
|
+
<a href="#M000026" class="method-signature">
|
258
|
+
<span class="method-name">serial_number</span><span class="method-args">()</span>
|
259
|
+
</a>
|
260
|
+
</div>
|
261
|
+
|
262
|
+
<div class="method-description">
|
263
|
+
<p>
|
264
|
+
製造番号を返す。無ければ <tt>nil</tt> を返す。
|
265
|
+
</p>
|
266
|
+
<p><a class="source-toggle" href="#"
|
267
|
+
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
268
|
+
<div class="method-source-code" id="M000026-source">
|
269
|
+
<pre>
|
270
|
+
<span class="ruby-comment cmt"># File lib/jpmobile/mobile/softbank.rb, line 16</span>
|
271
|
+
16: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">serial_number</span>
|
272
|
+
17: <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">'HTTP_USER_AGENT'</span>] <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/SN(.+?) /</span>
|
273
|
+
18: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">$1</span>
|
274
|
+
19: <span class="ruby-keyword kw">end</span>
|
275
|
+
</pre>
|
276
|
+
</div>
|
277
|
+
</div>
|
278
|
+
</div>
|
279
|
+
|
280
|
+
<div id="method-M000032" class="method-detail">
|
281
|
+
<a name="M000032"></a>
|
282
|
+
|
283
|
+
<div class="method-heading">
|
284
|
+
<a href="#M000032" class="method-signature">
|
285
|
+
<span class="method-name">supports_cookie?</span><span class="method-args">()</span>
|
286
|
+
</a>
|
287
|
+
</div>
|
288
|
+
|
289
|
+
<div class="method-description">
|
290
|
+
<p>
|
291
|
+
cookieに対応しているか?
|
292
|
+
</p>
|
293
|
+
<p><a class="source-toggle" href="#"
|
294
|
+
onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
|
295
|
+
<div class="method-source-code" id="M000032-source">
|
296
|
+
<pre>
|
297
|
+
<span class="ruby-comment cmt"># File lib/jpmobile/mobile/softbank.rb, line 65</span>
|
298
|
+
65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">supports_cookie?</span>
|
299
|
+
66: <span class="ruby-keyword kw">true</span>
|
300
|
+
67: <span class="ruby-keyword kw">end</span>
|
301
|
+
</pre>
|
302
|
+
</div>
|
303
|
+
</div>
|
304
|
+
</div>
|
305
|
+
|
306
|
+
<div id="method-M000028" class="method-detail">
|
307
|
+
<a name="M000028"></a>
|
308
|
+
|
309
|
+
<div class="method-heading">
|
310
|
+
<a href="#M000028" class="method-signature">
|
311
|
+
<span class="method-name">x_jphone_uid</span><span class="method-args">()</span>
|
312
|
+
</a>
|
313
|
+
</div>
|
314
|
+
|
315
|
+
<div class="method-description">
|
316
|
+
<p>
|
317
|
+
UIDを返す。
|
318
|
+
</p>
|
319
|
+
<p><a class="source-toggle" href="#"
|
320
|
+
onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
|
321
|
+
<div class="method-source-code" id="M000028-source">
|
322
|
+
<pre>
|
323
|
+
<span class="ruby-comment cmt"># File lib/jpmobile/mobile/softbank.rb, line 23</span>
|
324
|
+
23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">x_jphone_uid</span>
|
325
|
+
24: <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">"HTTP_X_JPHONE_UID"</span>]
|
326
|
+
25: <span class="ruby-keyword kw">end</span>
|
327
|
+
</pre>
|
328
|
+
</div>
|
329
|
+
</div>
|
330
|
+
</div>
|
331
|
+
|
332
|
+
|
333
|
+
</div>
|
334
|
+
|
335
|
+
|
336
|
+
</div>
|
337
|
+
|
338
|
+
|
339
|
+
<div id="validator-badges">
|
340
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
341
|
+
</div>
|
342
|
+
|
343
|
+
</body>
|
344
|
+
</html>
|