wwwjdic 13.0.0 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +63 -1
- data/Gemfile +9 -1
- data/README.md +499 -225
- data/Rakefile +12 -3
- data/copyright.md +17 -29
- data/examples/basics.rb +55 -45
- data/examples/translate.rb +161 -86
- data/examples/uri.rb +50 -78
- data/html/CHANGELOG.html +80 -21
- data/html/COPYING_md.html +13 -24
- data/html/Gemfile.html +12 -21
- data/html/Object.html +810 -45
- data/html/README_md.html +309 -161
- data/html/Rakefile.html +15 -24
- data/html/WWWJDic.html +41 -81
- data/html/WWWJDic/ParsableDuckType.html +15 -34
- data/html/WWWJDic/Parser.html +25 -64
- data/html/WWWJDic/Parsers.html +8 -13
- data/html/WWWJDic/Parsers/Dict.html +29 -54
- data/html/WWWJDic/Parsers/Display.html +24 -47
- data/html/WWWJDic/Parsers/Key.html +25 -48
- data/html/WWWJDic/Parsers/Search.html +19 -38
- data/html/WWWJDic/Parsers/Server.html +24 -47
- data/html/WWWJDic/Splitter.html +49 -142
- data/html/WWWJDic/Utils.html +9 -14
- data/html/WWWJDic/Utils/Downloader.html +8 -13
- data/html/WWWJDic/Utils/Downloader/Downloader.html +29 -63
- data/html/WWWJDic/Utils/Raisers.html +21 -72
- data/html/WWWJDic/WWWJDic.html +131 -312
- data/html/copyright_md.html +206 -225
- data/html/created.rid +33 -58
- data/html/css/rdoc.css +35 -6
- data/html/index.html +301 -169
- data/html/js/darkfish.js +22 -99
- data/html/js/navigation.js +4 -40
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +32 -31
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +6 -6
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +160 -197
- data/lib/wwwjdic.rb +16 -15
- data/lib/wwwjdic/application.rb +69 -36
- data/lib/wwwjdic/constants.rb +48 -10
- data/lib/wwwjdic/locales/de.yml +9 -4
- data/lib/wwwjdic/locales/en.yml +9 -4
- data/lib/wwwjdic/locales/es.yml +9 -4
- data/lib/wwwjdic/locales/fr.yml +9 -4
- data/lib/wwwjdic/locales/hu.yml +9 -4
- data/lib/wwwjdic/locales/it.yml +9 -4
- data/lib/wwwjdic/locales/ja.yml +11 -5
- data/lib/wwwjdic/locales/nl.yml +9 -4
- data/lib/wwwjdic/locales/ru.yml +9 -4
- data/lib/wwwjdic/locales/sl.yml +9 -4
- data/lib/wwwjdic/locales/sv.yml +9 -4
- data/lib/wwwjdic/parser.rb +15 -8
- data/lib/wwwjdic/parsers/dict.rb +13 -8
- data/lib/wwwjdic/parsers/display.rb +10 -3
- data/lib/wwwjdic/parsers/key.rb +11 -3
- data/lib/wwwjdic/parsers/search.rb +12 -3
- data/lib/wwwjdic/parsers/server.rb +10 -3
- data/lib/wwwjdic/utils/downloader.rb +27 -30
- data/lib/wwwjdic/utils/raisers.rb +14 -15
- data/lib/wwwjdic/utils/splitter.rb +33 -18
- data/lib/wwwjdic/version.rb +28 -20
- data/test/test_helper.rb +12 -1
- data/test/test_wwwjdic.rb +12 -4
- data/test/wwwjdic/locales/de.yml +9 -1
- data/test/wwwjdic/locales/en.yml +9 -1
- data/test/wwwjdic/locales/es.yml +9 -1
- data/test/wwwjdic/locales/fr.yml +9 -1
- data/test/wwwjdic/locales/hu.yml +9 -1
- data/test/wwwjdic/locales/it.yml +10 -1
- data/test/wwwjdic/locales/ja.yml +11 -2
- data/test/wwwjdic/locales/nl.yml +9 -1
- data/test/wwwjdic/locales/ru.yml +9 -1
- data/test/wwwjdic/locales/sl.yml +9 -1
- data/test/wwwjdic/locales/sv.yml +9 -1
- data/test/wwwjdic/locales/test_locales.rb +43 -24
- data/test/wwwjdic/parsers/test_dict.rb +67 -37
- data/test/wwwjdic/parsers/test_display.rb +13 -5
- data/test/wwwjdic/parsers/test_key.rb +12 -4
- data/test/wwwjdic/parsers/test_server.rb +13 -5
- data/test/wwwjdic/test_application.rb +201 -149
- data/test/wwwjdic/test_parsable_duck_type.rb +11 -6
- data/test/wwwjdic/utils/test_downloader.rb +9 -1
- data/test/wwwjdic/utils/test_raisers.rb +48 -29
- data/wwwjdic.gemspec +46 -26
- metadata +55 -43
- data/acknowledgements.md +0 -55
- data/authors.md +0 -67
- data/html/acknowledgements_md.html +0 -149
- data/html/authors_md.html +0 -181
- data/html/js/jquery.js +0 -4
- data/html/wwwjdic_gemspec.html +0 -161
data/html/WWWJDic/Parser.html
CHANGED
@@ -4,22 +4,23 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<title>class WWWJDic::Parser - wwwjdic
|
7
|
+
<title>class WWWJDic::Parser - wwwjdic 16.0.0</title>
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
11
|
var index_rel_prefix = "../";
|
12
12
|
</script>
|
13
13
|
|
14
|
-
<script src="../js/
|
15
|
-
<script src="../js/
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
16
19
|
|
17
20
|
<link href="../css/fonts.css" rel="stylesheet">
|
18
21
|
<link href="../css/rdoc.css" rel="stylesheet">
|
19
22
|
|
20
23
|
|
21
|
-
|
22
|
-
|
23
24
|
<body id="top" role="document" class="class">
|
24
25
|
<nav role="navigation">
|
25
26
|
<div id="project-navigation">
|
@@ -56,26 +57,23 @@
|
|
56
57
|
|
57
58
|
<div id="class-metadata">
|
58
59
|
|
59
|
-
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
60
62
|
<h3>Parent</h3>
|
61
63
|
|
62
|
-
|
63
64
|
<p class="link"><a href="../Object.html">Object</a>
|
64
|
-
|
65
65
|
</div>
|
66
66
|
|
67
67
|
|
68
68
|
|
69
|
-
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
70
71
|
<div id="method-list-section" class="nav-section">
|
71
72
|
<h3>Methods</h3>
|
72
73
|
|
73
74
|
<ul class="link-list" role="directory">
|
74
|
-
|
75
75
|
<li ><a href="#method-c-new">::new</a>
|
76
|
-
|
77
76
|
<li ><a href="#method-i-parse">#parse</a>
|
78
|
-
|
79
77
|
</ul>
|
80
78
|
</div>
|
81
79
|
|
@@ -95,7 +93,7 @@
|
|
95
93
|
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
96
94
|
</dd><dt>Copyright
|
97
95
|
<dd>
|
98
|
-
<p>
|
96
|
+
<p>(C) 2014 Marco Bresciani</p>
|
99
97
|
</dd><dt>License
|
100
98
|
<dd>
|
101
99
|
<p>GNU General Public License version 3</p>
|
@@ -103,21 +101,15 @@
|
|
103
101
|
|
104
102
|
</section>
|
105
103
|
|
106
|
-
|
107
104
|
<section id="5Buntitled-5D" class="documentation-section">
|
108
|
-
|
109
105
|
|
110
|
-
|
111
106
|
|
112
|
-
|
113
107
|
|
114
|
-
|
115
108
|
<section class="attribute-method-details" class="method-section">
|
116
109
|
<header>
|
117
110
|
<h3>Attributes</h3>
|
118
111
|
</header>
|
119
112
|
|
120
|
-
|
121
113
|
<div id="attribute-i-parsers" class="method-detail">
|
122
114
|
<div class="method-heading attribute-method-heading">
|
123
115
|
<span class="method-name">parsers</span><span
|
@@ -126,108 +118,77 @@
|
|
126
118
|
|
127
119
|
<div class="method-description">
|
128
120
|
|
129
|
-
|
130
|
-
|
131
121
|
</div>
|
132
122
|
</div>
|
133
|
-
|
134
123
|
</section>
|
135
|
-
|
136
124
|
|
137
|
-
|
125
|
+
|
138
126
|
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
139
127
|
<header>
|
140
128
|
<h3>Public Class Methods</h3>
|
141
129
|
</header>
|
142
130
|
|
143
|
-
|
144
131
|
<div id="method-c-new" class="method-detail ">
|
145
|
-
|
146
132
|
<div class="method-heading">
|
147
133
|
<span class="method-name">new</span><span
|
148
134
|
class="method-args">(args = {})</span>
|
149
|
-
|
150
135
|
<span class="method-click-advice">click to toggle source</span>
|
151
|
-
|
152
136
|
</div>
|
153
|
-
|
154
137
|
|
155
138
|
<div class="method-description">
|
156
139
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
140
|
|
161
|
-
|
162
141
|
<div class="method-source-code" id="new-source">
|
163
142
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/parser.rb</span>
|
164
|
-
<span class="line-num">
|
165
|
-
<span class="line-num">
|
166
|
-
<span class="line-num">
|
167
|
-
<span class="line-num">
|
143
|
+
<span class="line-num">41</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">args</span> = {})
|
144
|
+
<span class="line-num">42</span> <span class="ruby-ivar">@parsers</span> = {}
|
145
|
+
<span class="line-num">43</span> <span class="ruby-constant">ALL_PARAMS</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">param</span><span class="ruby-operator">|</span> <span class="ruby-identifier">parsers</span>[<span class="ruby-identifier">param</span>] = <span class="ruby-identifier">args</span>[<span class="ruby-identifier">param</span>] } <span class="ruby-keyword">unless</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">nil?</span>
|
146
|
+
<span class="line-num">44</span> <span class="ruby-keyword">end</span></pre>
|
168
147
|
</div>
|
169
|
-
|
170
148
|
</div>
|
171
149
|
|
172
|
-
|
173
150
|
|
174
|
-
|
175
151
|
</div>
|
176
152
|
|
177
|
-
|
178
153
|
</section>
|
179
|
-
|
154
|
+
|
180
155
|
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
181
156
|
<header>
|
182
157
|
<h3>Public Instance Methods</h3>
|
183
158
|
</header>
|
184
159
|
|
185
|
-
|
186
160
|
<div id="method-i-parse" class="method-detail ">
|
187
|
-
|
188
161
|
<div class="method-heading">
|
189
162
|
<span class="method-name">parse</span><span
|
190
|
-
class="method-args">(method = nil,
|
191
|
-
|
163
|
+
class="method-args">(method = nil, params = nil)</span>
|
192
164
|
<span class="method-click-advice">click to toggle source</span>
|
193
|
-
|
194
165
|
</div>
|
195
|
-
|
196
166
|
|
197
167
|
<div class="method-description">
|
198
|
-
|
199
168
|
<p>Provides the duck type for a generic parsing object.</p>
|
200
|
-
|
201
|
-
|
202
169
|
|
203
|
-
|
204
170
|
<div class="method-source-code" id="parse-source">
|
205
171
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/parser.rb</span>
|
206
|
-
<span class="line-num">
|
207
|
-
<span class="line-num">
|
208
|
-
<span class="line-num">
|
209
|
-
<span class="line-num">
|
210
|
-
<span class="line-num">
|
172
|
+
<span class="line-num">47</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse</span>(<span class="ruby-identifier">method</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">params</span> = <span class="ruby-keyword">nil</span>)
|
173
|
+
<span class="line-num">48</span> <span class="ruby-identifier">a_parser</span> = <span class="ruby-keyword">nil</span>
|
174
|
+
<span class="line-num">49</span> <span class="ruby-identifier">a_parser</span> = <span class="ruby-identifier">parsers</span>[<span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_sym</span>] <span class="ruby-keyword">unless</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">parsers</span>.<span class="ruby-identifier">nil?</span>
|
175
|
+
<span class="line-num">50</span> <span class="ruby-identifier">a_parser</span>&.<span class="ruby-identifier">parse</span> <span class="ruby-identifier">params</span>
|
176
|
+
<span class="line-num">51</span> <span class="ruby-keyword">end</span></pre>
|
211
177
|
</div>
|
212
|
-
|
213
178
|
</div>
|
214
179
|
|
215
|
-
|
216
180
|
|
217
|
-
|
218
181
|
</div>
|
219
182
|
|
220
|
-
|
221
183
|
</section>
|
222
|
-
|
223
|
-
</section>
|
224
184
|
|
185
|
+
</section>
|
225
186
|
</main>
|
226
187
|
|
227
188
|
|
228
189
|
<footer id="validator-badges" role="contentinfo">
|
229
190
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
230
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
191
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
|
231
192
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
232
193
|
</footer>
|
233
194
|
|
data/html/WWWJDic/Parsers.html
CHANGED
@@ -4,22 +4,23 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<title>module WWWJDic::Parsers - wwwjdic
|
7
|
+
<title>module WWWJDic::Parsers - wwwjdic 16.0.0</title>
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
11
|
var index_rel_prefix = "../";
|
12
12
|
</script>
|
13
13
|
|
14
|
-
<script src="../js/
|
15
|
-
<script src="../js/
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
16
19
|
|
17
20
|
<link href="../css/fonts.css" rel="stylesheet">
|
18
21
|
<link href="../css/rdoc.css" rel="stylesheet">
|
19
22
|
|
20
23
|
|
21
|
-
|
22
|
-
|
23
24
|
<body id="top" role="document" class="module">
|
24
25
|
<nav role="navigation">
|
25
26
|
<div id="project-navigation">
|
@@ -72,25 +73,19 @@
|
|
72
73
|
|
73
74
|
</section>
|
74
75
|
|
75
|
-
|
76
76
|
<section id="5Buntitled-5D" class="documentation-section">
|
77
|
-
|
78
77
|
|
79
|
-
|
80
78
|
|
81
|
-
|
82
79
|
|
83
|
-
|
84
80
|
|
85
|
-
|
86
|
-
</section>
|
87
81
|
|
82
|
+
</section>
|
88
83
|
</main>
|
89
84
|
|
90
85
|
|
91
86
|
<footer id="validator-badges" role="contentinfo">
|
92
87
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
93
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
88
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
|
94
89
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
95
90
|
</footer>
|
96
91
|
|
@@ -4,22 +4,23 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<title>class WWWJDic::Parsers::Dict - wwwjdic
|
7
|
+
<title>class WWWJDic::Parsers::Dict - wwwjdic 16.0.0</title>
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../../";
|
11
11
|
var index_rel_prefix = "../../";
|
12
12
|
</script>
|
13
13
|
|
14
|
-
<script src="../../js/
|
15
|
-
<script src="../../js/
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
16
19
|
|
17
20
|
<link href="../../css/fonts.css" rel="stylesheet">
|
18
21
|
<link href="../../css/rdoc.css" rel="stylesheet">
|
19
22
|
|
20
23
|
|
21
|
-
|
22
|
-
|
23
24
|
<body id="top" role="document" class="class">
|
24
25
|
<nav role="navigation">
|
25
26
|
<div id="project-navigation">
|
@@ -56,35 +57,30 @@
|
|
56
57
|
|
57
58
|
<div id="class-metadata">
|
58
59
|
|
59
|
-
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
60
62
|
<h3>Parent</h3>
|
61
63
|
|
62
|
-
|
63
64
|
<p class="link"><a href="../../Object.html">Object</a>
|
64
|
-
|
65
65
|
</div>
|
66
66
|
|
67
|
-
|
67
|
+
|
68
|
+
<div id="includes-section" class="nav-section">
|
68
69
|
<h3>Included Modules</h3>
|
69
70
|
|
70
71
|
<ul class="link-list">
|
71
|
-
|
72
|
-
|
73
72
|
<li><a class="include" href="../Utils/Raisers.html">WWWJDic::Utils::Raisers</a>
|
74
|
-
|
75
|
-
|
76
73
|
</ul>
|
77
74
|
</div>
|
78
75
|
|
79
76
|
|
80
|
-
|
77
|
+
|
78
|
+
<!-- Method Quickref -->
|
81
79
|
<div id="method-list-section" class="nav-section">
|
82
80
|
<h3>Methods</h3>
|
83
81
|
|
84
82
|
<ul class="link-list" role="directory">
|
85
|
-
|
86
83
|
<li ><a href="#method-i-parse">#parse</a>
|
87
|
-
|
88
84
|
</ul>
|
89
85
|
</div>
|
90
86
|
|
@@ -106,7 +102,7 @@
|
|
106
102
|
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
107
103
|
</dd><dt>Copyright
|
108
104
|
<dd>
|
109
|
-
<p>
|
105
|
+
<p>(C) 2014 Marco Bresciani</p>
|
110
106
|
</dd><dt>License
|
111
107
|
<dd>
|
112
108
|
<p>GNU General Public License version 3</p>
|
@@ -114,78 +110,57 @@
|
|
114
110
|
|
115
111
|
</section>
|
116
112
|
|
117
|
-
|
118
113
|
<section id="5Buntitled-5D" class="documentation-section">
|
119
|
-
|
120
114
|
|
121
|
-
|
122
115
|
|
123
|
-
|
124
116
|
|
125
|
-
|
126
117
|
|
127
|
-
|
118
|
+
|
128
119
|
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
129
120
|
<header>
|
130
121
|
<h3>Public Instance Methods</h3>
|
131
122
|
</header>
|
132
123
|
|
133
|
-
|
134
124
|
<div id="method-i-parse" class="method-detail ">
|
135
|
-
|
136
125
|
<div class="method-heading">
|
137
126
|
<span class="method-name">parse</span><span
|
138
127
|
class="method-args">(value = '1')</span>
|
139
|
-
|
140
128
|
<span class="method-click-advice">click to toggle source</span>
|
141
|
-
|
142
129
|
</div>
|
143
|
-
|
144
130
|
|
145
131
|
<div class="method-description">
|
146
|
-
|
147
132
|
<p>The parsable duck type interface to every parser usage.</p>
|
148
|
-
|
149
|
-
|
150
133
|
|
151
|
-
|
152
134
|
<div class="method-source-code" id="parse-source">
|
153
135
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/parsers/dict.rb</span>
|
154
|
-
<span class="line-num">
|
155
|
-
<span class="line-num">
|
156
|
-
<span class="line-num">
|
157
|
-
<span class="line-num">
|
158
|
-
<span class="line-num">
|
159
|
-
<span class="line-num">
|
160
|
-
<span class="line-num">
|
161
|
-
<span class="line-num">
|
162
|
-
<span class="line-num">
|
163
|
-
<span class="line-num">
|
164
|
-
<span class="line-num">
|
165
|
-
<span class="line-num">
|
166
|
-
<span class="line-num">
|
167
|
-
<span class="line-num">54</span> <span class="ruby-keyword">end</span>
|
168
|
-
<span class="line-num">55</span> <span class="ruby-keyword">end</span></pre>
|
136
|
+
<span class="line-num">48</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse</span>(<span class="ruby-identifier">value</span> = <span class="ruby-string">'1'</span>)
|
137
|
+
<span class="line-num">49</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.nil'</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
|
138
|
+
<span class="line-num">50</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.param'</span>, <span class="ruby-value">value:</span> <span class="ruby-identifier">value</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:length</span>
|
139
|
+
<span class="line-num">51</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.param'</span>, <span class="ruby-value">value:</span> <span class="ruby-identifier">value</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">empty?</span>
|
140
|
+
<span class="line-num">52</span>
|
141
|
+
<span class="line-num">53</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
142
|
+
<span class="line-num">54</span> <span class="ruby-identifier">raiser_array</span>(<span class="ruby-string">'error.param'</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">DICTIONARY_CODES</span>)
|
143
|
+
<span class="line-num">55</span> <span class="ruby-identifier">value</span>
|
144
|
+
<span class="line-num">56</span> <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span>
|
145
|
+
<span class="line-num">57</span> <span class="ruby-identifier">raiser_array</span>(<span class="ruby-string">'error.param'</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">DICTIONARY_NAMES</span>)
|
146
|
+
<span class="line-num">58</span> <span class="ruby-constant">DICTS_BY_NAMES</span>[<span class="ruby-identifier">value</span>]
|
147
|
+
<span class="line-num">59</span> <span class="ruby-keyword">end</span>
|
148
|
+
<span class="line-num">60</span> <span class="ruby-keyword">end</span></pre>
|
169
149
|
</div>
|
170
|
-
|
171
150
|
</div>
|
172
151
|
|
173
|
-
|
174
152
|
|
175
|
-
|
176
153
|
</div>
|
177
154
|
|
178
|
-
|
179
155
|
</section>
|
180
|
-
|
181
|
-
</section>
|
182
156
|
|
157
|
+
</section>
|
183
158
|
</main>
|
184
159
|
|
185
160
|
|
186
161
|
<footer id="validator-badges" role="contentinfo">
|
187
162
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
188
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
163
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
|
189
164
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
190
165
|
</footer>
|
191
166
|
|
@@ -4,22 +4,23 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<title>class WWWJDic::Parsers::Display - wwwjdic
|
7
|
+
<title>class WWWJDic::Parsers::Display - wwwjdic 16.0.0</title>
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../../";
|
11
11
|
var index_rel_prefix = "../../";
|
12
12
|
</script>
|
13
13
|
|
14
|
-
<script src="../../js/
|
15
|
-
<script src="../../js/
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
16
19
|
|
17
20
|
<link href="../../css/fonts.css" rel="stylesheet">
|
18
21
|
<link href="../../css/rdoc.css" rel="stylesheet">
|
19
22
|
|
20
23
|
|
21
|
-
|
22
|
-
|
23
24
|
<body id="top" role="document" class="class">
|
24
25
|
<nav role="navigation">
|
25
26
|
<div id="project-navigation">
|
@@ -56,35 +57,30 @@
|
|
56
57
|
|
57
58
|
<div id="class-metadata">
|
58
59
|
|
59
|
-
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
60
62
|
<h3>Parent</h3>
|
61
63
|
|
62
|
-
|
63
64
|
<p class="link"><a href="../../Object.html">Object</a>
|
64
|
-
|
65
65
|
</div>
|
66
66
|
|
67
|
-
|
67
|
+
|
68
|
+
<div id="includes-section" class="nav-section">
|
68
69
|
<h3>Included Modules</h3>
|
69
70
|
|
70
71
|
<ul class="link-list">
|
71
|
-
|
72
|
-
|
73
72
|
<li><a class="include" href="../Utils/Raisers.html">WWWJDic::Utils::Raisers</a>
|
74
|
-
|
75
|
-
|
76
73
|
</ul>
|
77
74
|
</div>
|
78
75
|
|
79
76
|
|
80
|
-
|
77
|
+
|
78
|
+
<!-- Method Quickref -->
|
81
79
|
<div id="method-list-section" class="nav-section">
|
82
80
|
<h3>Methods</h3>
|
83
81
|
|
84
82
|
<ul class="link-list" role="directory">
|
85
|
-
|
86
83
|
<li ><a href="#method-i-parse">#parse</a>
|
87
|
-
|
88
84
|
</ul>
|
89
85
|
</div>
|
90
86
|
|
@@ -106,7 +102,7 @@
|
|
106
102
|
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
107
103
|
</dd><dt>Copyright
|
108
104
|
<dd>
|
109
|
-
<p>
|
105
|
+
<p>(C) 2014 Marco Bresciani</p>
|
110
106
|
</dd><dt>License
|
111
107
|
<dd>
|
112
108
|
<p>GNU General Public License version 3</p>
|
@@ -114,71 +110,52 @@
|
|
114
110
|
|
115
111
|
</section>
|
116
112
|
|
117
|
-
|
118
113
|
<section id="5Buntitled-5D" class="documentation-section">
|
119
|
-
|
120
114
|
|
121
|
-
|
122
115
|
|
123
|
-
|
124
116
|
|
125
|
-
|
126
117
|
|
127
|
-
|
118
|
+
|
128
119
|
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
129
120
|
<header>
|
130
121
|
<h3>Public Instance Methods</h3>
|
131
122
|
</header>
|
132
123
|
|
133
|
-
|
134
124
|
<div id="method-i-parse" class="method-detail ">
|
135
|
-
|
136
125
|
<div class="method-heading">
|
137
126
|
<span class="method-name">parse</span><span
|
138
127
|
class="method-args">(value = :display)</span>
|
139
|
-
|
140
128
|
<span class="method-click-advice">click to toggle source</span>
|
141
|
-
|
142
129
|
</div>
|
143
|
-
|
144
130
|
|
145
131
|
<div class="method-description">
|
146
|
-
|
147
132
|
<p>The parsable duck type interface to every parser usage.</p>
|
148
|
-
|
149
|
-
|
150
133
|
|
151
|
-
|
152
134
|
<div class="method-source-code" id="parse-source">
|
153
135
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/parsers/display.rb</span>
|
154
|
-
<span class="line-num">
|
155
|
-
<span class="line-num">
|
156
|
-
<span class="line-num">
|
157
|
-
<span class="line-num">
|
158
|
-
<span class="line-num">
|
159
|
-
<span class="line-num">
|
160
|
-
<span class="line-num">
|
161
|
-
<span class="line-num">
|
136
|
+
<span class="line-num">47</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse</span>(<span class="ruby-identifier">value</span> = <span class="ruby-value">:display</span>)
|
137
|
+
<span class="line-num">48</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.nil'</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
|
138
|
+
<span class="line-num">49</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.param'</span>, <span class="ruby-value">value:</span> <span class="ruby-identifier">value</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Symbol</span>
|
139
|
+
<span class="line-num">50</span>
|
140
|
+
<span class="line-num">51</span> <span class="ruby-identifier">raiser_array</span>(<span class="ruby-string">'error.param'</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">DISPLAY</span>.<span class="ruby-identifier">keys</span>)
|
141
|
+
<span class="line-num">52</span>
|
142
|
+
<span class="line-num">53</span> <span class="ruby-identifier">value</span>
|
143
|
+
<span class="line-num">54</span> <span class="ruby-keyword">end</span></pre>
|
162
144
|
</div>
|
163
|
-
|
164
145
|
</div>
|
165
146
|
|
166
|
-
|
167
147
|
|
168
|
-
|
169
148
|
</div>
|
170
149
|
|
171
|
-
|
172
150
|
</section>
|
173
|
-
|
174
|
-
</section>
|
175
151
|
|
152
|
+
</section>
|
176
153
|
</main>
|
177
154
|
|
178
155
|
|
179
156
|
<footer id="validator-badges" role="contentinfo">
|
180
157
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
181
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
158
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
|
182
159
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
183
160
|
</footer>
|
184
161
|
|