zengin_lite 0.1.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 +7 -0
- data/.yardoc/checksums +5 -0
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/.yardopts +3 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +21 -0
- data/README.md +91 -0
- data/Rakefile +24 -0
- data/data/zengin.db +0 -0
- data/doc/ZenginLite/Bank.html +1008 -0
- data/doc/ZenginLite/Branch.html +929 -0
- data/doc/ZenginLite/Database.html +832 -0
- data/doc/ZenginLite/Error.html +124 -0
- data/doc/ZenginLite.html +492 -0
- data/doc/_index.html +159 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +490 -0
- data/doc/file.README.html +186 -0
- data/doc/file_list.html +59 -0
- data/doc/frames.html +22 -0
- data/doc/index.html +186 -0
- data/doc/js/app.js +395 -0
- data/doc/js/full_list.js +244 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +358 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/zengin_lite/bank.rb +65 -0
- data/lib/zengin_lite/branch.rb +47 -0
- data/lib/zengin_lite/database.rb +91 -0
- data/lib/zengin_lite/version.rb +3 -0
- data/lib/zengin_lite.rb +44 -0
- data/zengin_lite.gemspec +42 -0
- metadata +153 -0
|
@@ -0,0 +1,832 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>
|
|
7
|
+
Class: ZenginLite::Database
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.9.38
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript">
|
|
18
|
+
pathId = "ZenginLite::Database";
|
|
19
|
+
relpath = '../';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
24
|
+
|
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<div class="nav_wrap">
|
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
|
32
|
+
<div id="resizer"></div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="main" tabindex="-1">
|
|
36
|
+
<div id="header">
|
|
37
|
+
<div id="menu">
|
|
38
|
+
|
|
39
|
+
<a href="../_index.html">Index (D)</a> »
|
|
40
|
+
<span class='title'><span class='object_link'><a href="../ZenginLite.html" title="ZenginLite (module)">ZenginLite</a></span></span>
|
|
41
|
+
»
|
|
42
|
+
<span class="title">Database</span>
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div id="search">
|
|
47
|
+
|
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
|
49
|
+
href="../class_list.html">
|
|
50
|
+
|
|
51
|
+
<svg width="24" height="24">
|
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
</svg>
|
|
56
|
+
</a>
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
<div class="clear"></div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div id="content"><h1>Class: ZenginLite::Database
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
<span class="private note title">Private</span>
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
<dl>
|
|
70
|
+
<dt>Inherits:</dt>
|
|
71
|
+
<dd>
|
|
72
|
+
<span class="inheritName">Object</span>
|
|
73
|
+
|
|
74
|
+
<ul class="fullTree">
|
|
75
|
+
<li>Object</li>
|
|
76
|
+
|
|
77
|
+
<li class="next">ZenginLite::Database</li>
|
|
78
|
+
|
|
79
|
+
</ul>
|
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
81
|
+
|
|
82
|
+
</dd>
|
|
83
|
+
</dl>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
<dl>
|
|
96
|
+
<dt>Defined in:</dt>
|
|
97
|
+
<dd>lib/zengin_lite/database.rb</dd>
|
|
98
|
+
</dl>
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div class="docstring">
|
|
103
|
+
<div class="discussion">
|
|
104
|
+
<p class="note private">
|
|
105
|
+
<strong>This class is part of a private API.</strong>
|
|
106
|
+
You should avoid using this class if possible, as it may be removed or be changed in the future.
|
|
107
|
+
</p>
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="tags">
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
<h2>
|
|
124
|
+
Class Method Summary
|
|
125
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
126
|
+
</h2>
|
|
127
|
+
|
|
128
|
+
<ul class="summary">
|
|
129
|
+
|
|
130
|
+
<li class="public ">
|
|
131
|
+
<span class="summary_signature">
|
|
132
|
+
|
|
133
|
+
<a href="#close-class_method" title="close (class method)">.<strong>close</strong> ⇒ Object </a>
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
</span>
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
<span class="private note title">private</span>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
148
|
+
|
|
149
|
+
</li>
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
<li class="public ">
|
|
153
|
+
<span class="summary_signature">
|
|
154
|
+
|
|
155
|
+
<a href="#connection-class_method" title="connection (class method)">.<strong>connection</strong> ⇒ Object </a>
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
</span>
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
<span class="private note title">private</span>
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
170
|
+
|
|
171
|
+
</li>
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
<li class="public ">
|
|
175
|
+
<span class="summary_signature">
|
|
176
|
+
|
|
177
|
+
<a href="#each_bank-class_method" title="each_bank (class method)">.<strong>each_bank</strong>(&block) ⇒ Object </a>
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
</span>
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
<span class="private note title">private</span>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
192
|
+
|
|
193
|
+
</li>
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
<li class="public ">
|
|
197
|
+
<span class="summary_signature">
|
|
198
|
+
|
|
199
|
+
<a href="#find_bank-class_method" title="find_bank (class method)">.<strong>find_bank</strong>(code:) ⇒ Object </a>
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
</span>
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
<span class="private note title">private</span>
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
<span class="summary_desc"><div class='inline'>
|
|
214
|
+
<p>Query methods.</p>
|
|
215
|
+
</div></span>
|
|
216
|
+
|
|
217
|
+
</li>
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
<li class="public ">
|
|
221
|
+
<span class="summary_signature">
|
|
222
|
+
|
|
223
|
+
<a href="#find_branch-class_method" title="find_branch (class method)">.<strong>find_branch</strong>(bank_code:, branch_code:) ⇒ Object </a>
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
</span>
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
<span class="private note title">private</span>
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
238
|
+
|
|
239
|
+
</li>
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
<li class="public ">
|
|
243
|
+
<span class="summary_signature">
|
|
244
|
+
|
|
245
|
+
<a href="#find_branches-class_method" title="find_branches (class method)">.<strong>find_branches</strong>(bank_code:, limit: 100) ⇒ Object </a>
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
</span>
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
<span class="private note title">private</span>
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
260
|
+
|
|
261
|
+
</li>
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
<li class="public ">
|
|
265
|
+
<span class="summary_signature">
|
|
266
|
+
|
|
267
|
+
<a href="#metadata-class_method" title="metadata (class method)">.<strong>metadata</strong>(key) ⇒ Object </a>
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
</span>
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
<span class="private note title">private</span>
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
282
|
+
|
|
283
|
+
</li>
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
<li class="public ">
|
|
287
|
+
<span class="summary_signature">
|
|
288
|
+
|
|
289
|
+
<a href="#search_banks-class_method" title="search_banks (class method)">.<strong>search_banks</strong>(name: nil, kana: nil, limit: 10) ⇒ Object </a>
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
</span>
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
<span class="private note title">private</span>
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
304
|
+
|
|
305
|
+
</li>
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
<li class="public ">
|
|
309
|
+
<span class="summary_signature">
|
|
310
|
+
|
|
311
|
+
<a href="#stats-class_method" title="stats (class method)">.<strong>stats</strong> ⇒ Object </a>
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
</span>
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
<span class="private note title">private</span>
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
326
|
+
|
|
327
|
+
</li>
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
</ul>
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
<div id="class_method_details" class="method_details_list">
|
|
336
|
+
<h2>Class Method Details</h2>
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
<div class="method_details first">
|
|
340
|
+
<h3 class="signature first" id="close-class_method">
|
|
341
|
+
|
|
342
|
+
.<strong>close</strong> ⇒ <tt>Object</tt>
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
</h3><div class="docstring">
|
|
349
|
+
<div class="discussion">
|
|
350
|
+
<p class="note private">
|
|
351
|
+
<strong>This method is part of a private API.</strong>
|
|
352
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
353
|
+
</p>
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
</div>
|
|
357
|
+
</div>
|
|
358
|
+
<div class="tags">
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
</div><table class="source_code">
|
|
362
|
+
<tr>
|
|
363
|
+
<td>
|
|
364
|
+
<pre class="lines">
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
19
|
|
368
|
+
20
|
|
369
|
+
21
|
|
370
|
+
22</pre>
|
|
371
|
+
</td>
|
|
372
|
+
<td>
|
|
373
|
+
<pre class="code"><span class="info file"># File 'lib/zengin_lite/database.rb', line 19</span>
|
|
374
|
+
|
|
375
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
|
|
376
|
+
<span class='ivar'>@connection</span><span class='op'>&.</span><span class='id identifier rubyid_close'>close</span>
|
|
377
|
+
<span class='ivar'>@connection</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
378
|
+
<span class='kw'>end</span></pre>
|
|
379
|
+
</td>
|
|
380
|
+
</tr>
|
|
381
|
+
</table>
|
|
382
|
+
</div>
|
|
383
|
+
|
|
384
|
+
<div class="method_details ">
|
|
385
|
+
<h3 class="signature " id="connection-class_method">
|
|
386
|
+
|
|
387
|
+
.<strong>connection</strong> ⇒ <tt>Object</tt>
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
</h3><div class="docstring">
|
|
394
|
+
<div class="discussion">
|
|
395
|
+
<p class="note private">
|
|
396
|
+
<strong>This method is part of a private API.</strong>
|
|
397
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
398
|
+
</p>
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
</div>
|
|
402
|
+
</div>
|
|
403
|
+
<div class="tags">
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
</div><table class="source_code">
|
|
407
|
+
<tr>
|
|
408
|
+
<td>
|
|
409
|
+
<pre class="lines">
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
7
|
|
413
|
+
8
|
|
414
|
+
9
|
|
415
|
+
10
|
|
416
|
+
11
|
|
417
|
+
12
|
|
418
|
+
13
|
|
419
|
+
14
|
|
420
|
+
15
|
|
421
|
+
16
|
|
422
|
+
17</pre>
|
|
423
|
+
</td>
|
|
424
|
+
<td>
|
|
425
|
+
<pre class="code"><span class="info file"># File 'lib/zengin_lite/database.rb', line 7</span>
|
|
426
|
+
|
|
427
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_connection'>connection</span>
|
|
428
|
+
<span class='ivar'>@connection</span> <span class='op'>||=</span> <span class='kw'>begin</span>
|
|
429
|
+
<span class='kw'>unless</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../ZenginLite.html" title="ZenginLite (module)">ZenginLite</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../ZenginLite.html#DB_PATH-constant" title="ZenginLite::DB_PATH (constant)">DB_PATH</a></span></span><span class='rparen'>)</span>
|
|
430
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Database file not found: </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../ZenginLite.html" title="ZenginLite (module)">ZenginLite</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../ZenginLite.html#DB_PATH-constant" title="ZenginLite::DB_PATH (constant)">DB_PATH</a></span></span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
431
|
+
<span class='kw'>end</span>
|
|
432
|
+
|
|
433
|
+
<span class='id identifier rubyid_db'>db</span> <span class='op'>=</span> <span class='const'>SQLite3</span><span class='op'>::</span><span class='const'>Database</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../ZenginLite.html" title="ZenginLite (module)">ZenginLite</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../ZenginLite.html#DB_PATH-constant" title="ZenginLite::DB_PATH (constant)">DB_PATH</a></span></span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
|
434
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_results_as_hash'>results_as_hash</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
435
|
+
<span class='id identifier rubyid_db'>db</span>
|
|
436
|
+
<span class='kw'>end</span>
|
|
437
|
+
<span class='kw'>end</span></pre>
|
|
438
|
+
</td>
|
|
439
|
+
</tr>
|
|
440
|
+
</table>
|
|
441
|
+
</div>
|
|
442
|
+
|
|
443
|
+
<div class="method_details ">
|
|
444
|
+
<h3 class="signature " id="each_bank-class_method">
|
|
445
|
+
|
|
446
|
+
.<strong>each_bank</strong>(&block) ⇒ <tt>Object</tt>
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
</h3><div class="docstring">
|
|
453
|
+
<div class="discussion">
|
|
454
|
+
<p class="note private">
|
|
455
|
+
<strong>This method is part of a private API.</strong>
|
|
456
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
457
|
+
</p>
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
</div>
|
|
461
|
+
</div>
|
|
462
|
+
<div class="tags">
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
</div><table class="source_code">
|
|
466
|
+
<tr>
|
|
467
|
+
<td>
|
|
468
|
+
<pre class="lines">
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
52
|
|
472
|
+
53
|
|
473
|
+
54
|
|
474
|
+
55
|
|
475
|
+
56</pre>
|
|
476
|
+
</td>
|
|
477
|
+
<td>
|
|
478
|
+
<pre class="code"><span class="info file"># File 'lib/zengin_lite/database.rb', line 52</span>
|
|
479
|
+
|
|
480
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_each_bank'>each_bank</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
481
|
+
<span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SELECT code, name, kana, hira, roma FROM banks</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_row'>row</span><span class='op'>|</span>
|
|
482
|
+
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_row'>row</span><span class='rparen'>)</span>
|
|
483
|
+
<span class='kw'>end</span>
|
|
484
|
+
<span class='kw'>end</span></pre>
|
|
485
|
+
</td>
|
|
486
|
+
</tr>
|
|
487
|
+
</table>
|
|
488
|
+
</div>
|
|
489
|
+
|
|
490
|
+
<div class="method_details ">
|
|
491
|
+
<h3 class="signature " id="find_bank-class_method">
|
|
492
|
+
|
|
493
|
+
.<strong>find_bank</strong>(code:) ⇒ <tt>Object</tt>
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
</h3><div class="docstring">
|
|
500
|
+
<div class="discussion">
|
|
501
|
+
<p class="note private">
|
|
502
|
+
<strong>This method is part of a private API.</strong>
|
|
503
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
504
|
+
</p>
|
|
505
|
+
|
|
506
|
+
<p>Query methods</p>
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
</div>
|
|
510
|
+
</div>
|
|
511
|
+
<div class="tags">
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
</div><table class="source_code">
|
|
515
|
+
<tr>
|
|
516
|
+
<td>
|
|
517
|
+
<pre class="lines">
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
25
|
|
521
|
+
26
|
|
522
|
+
27
|
|
523
|
+
28
|
|
524
|
+
29
|
|
525
|
+
30</pre>
|
|
526
|
+
</td>
|
|
527
|
+
<td>
|
|
528
|
+
<pre class="code"><span class="info file"># File 'lib/zengin_lite/database.rb', line 25</span>
|
|
529
|
+
|
|
530
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find_bank'>find_bank</span><span class='lparen'>(</span><span class='label'>code:</span><span class='rparen'>)</span>
|
|
531
|
+
<span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_get_first_row'>get_first_row</span><span class='lparen'>(</span>
|
|
532
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SELECT code, name, kana, hira, roma FROM banks WHERE code = ?</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
|
533
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_code'>code</span><span class='rbracket'>]</span>
|
|
534
|
+
<span class='rparen'>)</span>
|
|
535
|
+
<span class='kw'>end</span></pre>
|
|
536
|
+
</td>
|
|
537
|
+
</tr>
|
|
538
|
+
</table>
|
|
539
|
+
</div>
|
|
540
|
+
|
|
541
|
+
<div class="method_details ">
|
|
542
|
+
<h3 class="signature " id="find_branch-class_method">
|
|
543
|
+
|
|
544
|
+
.<strong>find_branch</strong>(bank_code:, branch_code:) ⇒ <tt>Object</tt>
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
</h3><div class="docstring">
|
|
551
|
+
<div class="discussion">
|
|
552
|
+
<p class="note private">
|
|
553
|
+
<strong>This method is part of a private API.</strong>
|
|
554
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
555
|
+
</p>
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
</div>
|
|
559
|
+
</div>
|
|
560
|
+
<div class="tags">
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
</div><table class="source_code">
|
|
564
|
+
<tr>
|
|
565
|
+
<td>
|
|
566
|
+
<pre class="lines">
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
58
|
|
570
|
+
59
|
|
571
|
+
60
|
|
572
|
+
61
|
|
573
|
+
62
|
|
574
|
+
63</pre>
|
|
575
|
+
</td>
|
|
576
|
+
<td>
|
|
577
|
+
<pre class="code"><span class="info file"># File 'lib/zengin_lite/database.rb', line 58</span>
|
|
578
|
+
|
|
579
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find_branch'>find_branch</span><span class='lparen'>(</span><span class='label'>bank_code:</span><span class='comma'>,</span> <span class='label'>branch_code:</span><span class='rparen'>)</span>
|
|
580
|
+
<span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_get_first_row'>get_first_row</span><span class='lparen'>(</span>
|
|
581
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SELECT code, bank_code, name, kana, hira, roma FROM branches WHERE bank_code = ? AND code = ?</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
|
582
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_bank_code'>bank_code</span><span class='comma'>,</span> <span class='id identifier rubyid_branch_code'>branch_code</span><span class='rbracket'>]</span>
|
|
583
|
+
<span class='rparen'>)</span>
|
|
584
|
+
<span class='kw'>end</span></pre>
|
|
585
|
+
</td>
|
|
586
|
+
</tr>
|
|
587
|
+
</table>
|
|
588
|
+
</div>
|
|
589
|
+
|
|
590
|
+
<div class="method_details ">
|
|
591
|
+
<h3 class="signature " id="find_branches-class_method">
|
|
592
|
+
|
|
593
|
+
.<strong>find_branches</strong>(bank_code:, limit: 100) ⇒ <tt>Object</tt>
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
</h3><div class="docstring">
|
|
600
|
+
<div class="discussion">
|
|
601
|
+
<p class="note private">
|
|
602
|
+
<strong>This method is part of a private API.</strong>
|
|
603
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
604
|
+
</p>
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
</div>
|
|
608
|
+
</div>
|
|
609
|
+
<div class="tags">
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
</div><table class="source_code">
|
|
613
|
+
<tr>
|
|
614
|
+
<td>
|
|
615
|
+
<pre class="lines">
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
65
|
|
619
|
+
66
|
|
620
|
+
67
|
|
621
|
+
68
|
|
622
|
+
69
|
|
623
|
+
70
|
|
624
|
+
71</pre>
|
|
625
|
+
</td>
|
|
626
|
+
<td>
|
|
627
|
+
<pre class="code"><span class="info file"># File 'lib/zengin_lite/database.rb', line 65</span>
|
|
628
|
+
|
|
629
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find_branches'>find_branches</span><span class='lparen'>(</span><span class='label'>bank_code:</span><span class='comma'>,</span> <span class='label'>limit:</span> <span class='int'>100</span><span class='rparen'>)</span>
|
|
630
|
+
<span class='id identifier rubyid_limit'>limit</span> <span class='op'>||=</span> <span class='op'>-</span><span class='int'>1</span>
|
|
631
|
+
<span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span>
|
|
632
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SELECT code, bank_code, name, kana, hira, roma FROM branches WHERE bank_code = ? LIMIT ?</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
|
633
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_bank_code'>bank_code</span><span class='comma'>,</span> <span class='id identifier rubyid_limit'>limit</span><span class='rbracket'>]</span>
|
|
634
|
+
<span class='rparen'>)</span>
|
|
635
|
+
<span class='kw'>end</span></pre>
|
|
636
|
+
</td>
|
|
637
|
+
</tr>
|
|
638
|
+
</table>
|
|
639
|
+
</div>
|
|
640
|
+
|
|
641
|
+
<div class="method_details ">
|
|
642
|
+
<h3 class="signature " id="metadata-class_method">
|
|
643
|
+
|
|
644
|
+
.<strong>metadata</strong>(key) ⇒ <tt>Object</tt>
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
</h3><div class="docstring">
|
|
651
|
+
<div class="discussion">
|
|
652
|
+
<p class="note private">
|
|
653
|
+
<strong>This method is part of a private API.</strong>
|
|
654
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
655
|
+
</p>
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
</div>
|
|
659
|
+
</div>
|
|
660
|
+
<div class="tags">
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
</div><table class="source_code">
|
|
664
|
+
<tr>
|
|
665
|
+
<td>
|
|
666
|
+
<pre class="lines">
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
73
|
|
670
|
+
74
|
|
671
|
+
75
|
|
672
|
+
76
|
|
673
|
+
77
|
|
674
|
+
78
|
|
675
|
+
79</pre>
|
|
676
|
+
</td>
|
|
677
|
+
<td>
|
|
678
|
+
<pre class="code"><span class="info file"># File 'lib/zengin_lite/database.rb', line 73</span>
|
|
679
|
+
|
|
680
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_metadata'>metadata</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
|
681
|
+
<span class='id identifier rubyid_row'>row</span> <span class='op'>=</span> <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_get_first_row'>get_first_row</span><span class='lparen'>(</span>
|
|
682
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SELECT value FROM metadata WHERE key = ?</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
|
683
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
|
684
|
+
<span class='rparen'>)</span>
|
|
685
|
+
<span class='id identifier rubyid_row'>row</span><span class='op'>&.</span><span class='id identifier rubyid_first'>first</span>
|
|
686
|
+
<span class='kw'>end</span></pre>
|
|
687
|
+
</td>
|
|
688
|
+
</tr>
|
|
689
|
+
</table>
|
|
690
|
+
</div>
|
|
691
|
+
|
|
692
|
+
<div class="method_details ">
|
|
693
|
+
<h3 class="signature " id="search_banks-class_method">
|
|
694
|
+
|
|
695
|
+
.<strong>search_banks</strong>(name: nil, kana: nil, limit: 10) ⇒ <tt>Object</tt>
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
</h3><div class="docstring">
|
|
702
|
+
<div class="discussion">
|
|
703
|
+
<p class="note private">
|
|
704
|
+
<strong>This method is part of a private API.</strong>
|
|
705
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
706
|
+
</p>
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
</div>
|
|
710
|
+
</div>
|
|
711
|
+
<div class="tags">
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
</div><table class="source_code">
|
|
715
|
+
<tr>
|
|
716
|
+
<td>
|
|
717
|
+
<pre class="lines">
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
32
|
|
721
|
+
33
|
|
722
|
+
34
|
|
723
|
+
35
|
|
724
|
+
36
|
|
725
|
+
37
|
|
726
|
+
38
|
|
727
|
+
39
|
|
728
|
+
40
|
|
729
|
+
41
|
|
730
|
+
42
|
|
731
|
+
43
|
|
732
|
+
44
|
|
733
|
+
45
|
|
734
|
+
46
|
|
735
|
+
47
|
|
736
|
+
48
|
|
737
|
+
49
|
|
738
|
+
50</pre>
|
|
739
|
+
</td>
|
|
740
|
+
<td>
|
|
741
|
+
<pre class="code"><span class="info file"># File 'lib/zengin_lite/database.rb', line 32</span>
|
|
742
|
+
|
|
743
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_search_banks'>search_banks</span><span class='lparen'>(</span><span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>kana:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>limit:</span> <span class='int'>10</span><span class='rparen'>)</span>
|
|
744
|
+
<span class='id identifier rubyid_sql'>sql</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SELECT code, name, kana, hira, roma FROM banks WHERE 1=1</span><span class='tstring_end'>'</span></span>
|
|
745
|
+
<span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
746
|
+
|
|
747
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
|
|
748
|
+
<span class='id identifier rubyid_sql'>sql</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> AND name LIKE ?</span><span class='tstring_end'>'</span></span>
|
|
749
|
+
<span class='id identifier rubyid_params'>params</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>%</span><span class='tstring_end'>"</span></span>
|
|
750
|
+
<span class='kw'>end</span>
|
|
751
|
+
|
|
752
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_kana'>kana</span>
|
|
753
|
+
<span class='id identifier rubyid_sql'>sql</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> AND kana LIKE ?</span><span class='tstring_end'>'</span></span>
|
|
754
|
+
<span class='id identifier rubyid_params'>params</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_kana'>kana</span><span class='embexpr_end'>}</span><span class='tstring_content'>%</span><span class='tstring_end'>"</span></span>
|
|
755
|
+
<span class='kw'>end</span>
|
|
756
|
+
|
|
757
|
+
<span class='id identifier rubyid_sql'>sql</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> LIMIT ?</span><span class='tstring_end'>'</span></span>
|
|
758
|
+
<span class='id identifier rubyid_params'>params</span> <span class='op'><<</span> <span class='id identifier rubyid_limit'>limit</span>
|
|
759
|
+
|
|
760
|
+
<span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='id identifier rubyid_sql'>sql</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
|
761
|
+
<span class='kw'>end</span></pre>
|
|
762
|
+
</td>
|
|
763
|
+
</tr>
|
|
764
|
+
</table>
|
|
765
|
+
</div>
|
|
766
|
+
|
|
767
|
+
<div class="method_details ">
|
|
768
|
+
<h3 class="signature " id="stats-class_method">
|
|
769
|
+
|
|
770
|
+
.<strong>stats</strong> ⇒ <tt>Object</tt>
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
</h3><div class="docstring">
|
|
777
|
+
<div class="discussion">
|
|
778
|
+
<p class="note private">
|
|
779
|
+
<strong>This method is part of a private API.</strong>
|
|
780
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
781
|
+
</p>
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
</div>
|
|
785
|
+
</div>
|
|
786
|
+
<div class="tags">
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
</div><table class="source_code">
|
|
790
|
+
<tr>
|
|
791
|
+
<td>
|
|
792
|
+
<pre class="lines">
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
81
|
|
796
|
+
82
|
|
797
|
+
83
|
|
798
|
+
84
|
|
799
|
+
85
|
|
800
|
+
86
|
|
801
|
+
87
|
|
802
|
+
88</pre>
|
|
803
|
+
</td>
|
|
804
|
+
<td>
|
|
805
|
+
<pre class="code"><span class="info file"># File 'lib/zengin_lite/database.rb', line 81</span>
|
|
806
|
+
|
|
807
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_stats'>stats</span>
|
|
808
|
+
<span class='lbrace'>{</span>
|
|
809
|
+
<span class='label'>banks_count:</span> <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_get_first_value'>get_first_value</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SELECT COUNT(*) FROM banks</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='comma'>,</span>
|
|
810
|
+
<span class='label'>branches_count:</span> <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_get_first_value'>get_first_value</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SELECT COUNT(*) FROM branches</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='comma'>,</span>
|
|
811
|
+
<span class='label'>updated_at:</span> <span class='id identifier rubyid_metadata'>metadata</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>updated_at</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='comma'>,</span>
|
|
812
|
+
<span class='label'>md5:</span> <span class='id identifier rubyid_metadata'>metadata</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>md5</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
813
|
+
<span class='rbrace'>}</span>
|
|
814
|
+
<span class='kw'>end</span></pre>
|
|
815
|
+
</td>
|
|
816
|
+
</tr>
|
|
817
|
+
</table>
|
|
818
|
+
</div>
|
|
819
|
+
|
|
820
|
+
</div>
|
|
821
|
+
|
|
822
|
+
</div>
|
|
823
|
+
|
|
824
|
+
<div id="footer">
|
|
825
|
+
Generated on Sat Feb 7 19:33:57 2026 by
|
|
826
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
827
|
+
0.9.38 (ruby-3.4.6).
|
|
828
|
+
</div>
|
|
829
|
+
|
|
830
|
+
</div>
|
|
831
|
+
</body>
|
|
832
|
+
</html>
|