student_mvp 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/README.md +35 -0
- data/Rakefile +4 -0
- data/doc/Add_student_presenter.html +238 -0
- data/doc/App_logger.html +386 -0
- data/doc/Base_presenter.html +265 -0
- data/doc/Binary_tree.html +300 -0
- data/doc/Binary_tree_iterator.html +217 -0
- data/doc/Contact_sort_decorator.html +219 -0
- data/doc/DB_client.html +252 -0
- data/doc/Data_list.html +625 -0
- data/doc/Data_list_student_short.html +148 -0
- data/doc/Data_storage_strategy.html +178 -0
- data/doc/Data_table.html +264 -0
- data/doc/Deep_dup.html +152 -0
- data/doc/Edit_contacts_presenter.html +199 -0
- data/doc/Edit_git_presenter.html +192 -0
- data/doc/Edit_student_presenter.html +464 -0
- data/doc/Field_filter_decorator.html +219 -0
- data/doc/Filter.html +148 -0
- data/doc/Filter_decorator.html +209 -0
- data/doc/Full_name_filter_decorator.html +211 -0
- data/doc/Full_name_sort_decorator.html +217 -0
- data/doc/Gemfile.html +98 -0
- data/doc/Git_sort_decorator.html +220 -0
- data/doc/Has_not_field_filter_decorator.html +209 -0
- data/doc/JSON_storage_strategy.html +183 -0
- data/doc/Person.html +511 -0
- data/doc/README_md.html +147 -0
- data/doc/Rakefile.html +94 -0
- data/doc/Replace_student_presenter.html +204 -0
- data/doc/Sort_decorator.html +214 -0
- data/doc/Student.html +755 -0
- data/doc/StudentMvp/Error.html +105 -0
- data/doc/StudentMvp.html +111 -0
- data/doc/Student_list_presenter.html +667 -0
- data/doc/Student_short.html +398 -0
- data/doc/Students_list.html +341 -0
- data/doc/Students_list_DB.html +361 -0
- data/doc/Students_list_file.html +460 -0
- data/doc/Students_list_file_adapter.html +341 -0
- data/doc/Students_list_interface.html +298 -0
- data/doc/YAML_storage_strategy.html +183 -0
- data/doc/bin/setup.html +96 -0
- data/doc/created.rid +44 -0
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +662 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +174 -0
- data/doc/js/darkfish.js +114 -0
- data/doc/js/navigation.js +105 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +110 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +229 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +1047 -0
- data/lib/data_access/DB_client/DB_client.rb +26 -0
- data/lib/deep_dup/deep_dup.rb +14 -0
- data/lib/logger/logger.rb +64 -0
- data/lib/models/binary_tree/binary_tree.rb +163 -0
- data/lib/models/binary_tree/binary_tree_iterator.rb +36 -0
- data/lib/models/data_list/data_list.rb +97 -0
- data/lib/models/data_list/data_list_student_short.rb +16 -0
- data/lib/models/data_storage_strategy/JSON_storage_strategy.rb +20 -0
- data/lib/models/data_storage_strategy/YAML_storage_strategy.rb +20 -0
- data/lib/models/data_storage_strategy/data_storage_strategy.rb +11 -0
- data/lib/models/data_table/data_table.rb +52 -0
- data/lib/models/filter/filter.rb +5 -0
- data/lib/models/filter/filter_decorator.rb +14 -0
- data/lib/models/filter/sort_decorator.rb +15 -0
- data/lib/models/filter/student_filters/contact_sort_decorator.rb +50 -0
- data/lib/models/filter/student_filters/field_filter_decorator.rb +34 -0
- data/lib/models/filter/student_filters/full_name_filter_decorator.rb +26 -0
- data/lib/models/filter/student_filters/full_name_sort_decorator.rb +32 -0
- data/lib/models/filter/student_filters/git_sort_decorator.rb +35 -0
- data/lib/models/filter/student_filters/has_not_field_filter_decorator.rb +24 -0
- data/lib/models/person/person.rb +72 -0
- data/lib/models/student/student.rb +204 -0
- data/lib/models/student_short/student_short.rb +98 -0
- data/lib/models/students_list/students_list.rb +32 -0
- data/lib/models/students_list/students_list_DB.rb +95 -0
- data/lib/models/students_list/students_list_file.rb +134 -0
- data/lib/models/students_list/students_list_file_adapter.rb +45 -0
- data/lib/models/students_list/students_list_interface.rb +25 -0
- data/lib/presenters/base_presenters/base_presenter.rb +26 -0
- data/lib/presenters/base_presenters/student_list_presenter.rb +273 -0
- data/lib/presenters/edit_student/add_student_presenter.rb +46 -0
- data/lib/presenters/edit_student/edit_contacts_presenter.rb +36 -0
- data/lib/presenters/edit_student/edit_git_presenter.rb +28 -0
- data/lib/presenters/edit_student/edit_student_presenter.rb +109 -0
- data/lib/presenters/edit_student/replace_student_presenter.rb +37 -0
- data/lib/student_mvp/version.rb +5 -0
- data/lib/student_mvp.rb +8 -0
- data/sig/student_mvp.rbs +4 -0
- metadata +253 -0
@@ -0,0 +1,219 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
7
|
+
|
8
|
+
<title>class Contact_sort_decorator - RDoc Documentation</title>
|
9
|
+
|
10
|
+
<meta name="keywords" content="ruby,class,Contact_sort_decorator">
|
11
|
+
|
12
|
+
<meta name="description" content="Documentation for the Contact_sort_decorator class">
|
13
|
+
|
14
|
+
<script type="text/javascript">
|
15
|
+
var rdoc_rel_prefix = "./";
|
16
|
+
var index_rel_prefix = "./";
|
17
|
+
</script>
|
18
|
+
|
19
|
+
<script src="./js/navigation.js" defer></script>
|
20
|
+
<script src="./js/search.js" defer></script>
|
21
|
+
<script src="./js/search_index.js" defer></script>
|
22
|
+
<script src="./js/searcher.js" defer></script>
|
23
|
+
<script src="./js/darkfish.js" defer></script>
|
24
|
+
|
25
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
26
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
27
|
+
|
28
|
+
|
29
|
+
<body id="top" role="document" class="class">
|
30
|
+
<div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
|
31
|
+
<span aria-hidden="true">☰</span>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
|
35
|
+
<nav id="navigation" role="navigation">
|
36
|
+
<div id="project-navigation">
|
37
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
38
|
+
<h2>
|
39
|
+
<a href="./index.html" rel="home">Home</a>
|
40
|
+
</h2>
|
41
|
+
|
42
|
+
<div id="table-of-contents-navigation">
|
43
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
44
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
45
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
50
|
+
<form action="#" method="get" accept-charset="utf-8">
|
51
|
+
<div id="search-field-wrapper">
|
52
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
53
|
+
aria-autocomplete="list" aria-controls="search-results"
|
54
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
55
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
56
|
+
</div>
|
57
|
+
|
58
|
+
<ul id="search-results" aria-label="Search Results"
|
59
|
+
aria-busy="false" aria-expanded="false"
|
60
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
61
|
+
</form>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
</div>
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
<div id="parent-class-section" class="nav-section">
|
69
|
+
<h3>Ancestors</h3>
|
70
|
+
<ul><li><a href="Filter_decorator.html">Filter_decorator</a><ul><li><a href="Filter.html">Filter</a><ul><li>Object</li></ul></li></ul></li></ul>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
<div class="nav-section">
|
77
|
+
<h3>Class Methods</h3>
|
78
|
+
<ul class="link-list" role="directory">
|
79
|
+
<li class="calls-super" ><a href="#method-c-new">new</a></li>
|
80
|
+
</ul>
|
81
|
+
</div>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<div class="nav-section">
|
86
|
+
<h3>Instance Methods</h3>
|
87
|
+
<ul class="link-list" role="directory">
|
88
|
+
<li class="calls-super" ><a href="#method-i-apply">apply</a></li>
|
89
|
+
</ul>
|
90
|
+
</div>
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
<footer id="validator-badges" role="contentinfo">
|
95
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
96
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.8.1.
|
97
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
98
|
+
</footer>
|
99
|
+
|
100
|
+
</nav>
|
101
|
+
|
102
|
+
<main role="main" aria-labelledby="class-Contact_sort_decorator">
|
103
|
+
<h1 id="class-Contact_sort_decorator" class="anchor-link class">
|
104
|
+
class Contact_sort_decorator
|
105
|
+
</h1>
|
106
|
+
|
107
|
+
<section class="description">
|
108
|
+
|
109
|
+
</section>
|
110
|
+
|
111
|
+
<section id="5Buntitled-5D" class="documentation-section anchor-link">
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section anchor-link">
|
118
|
+
<header>
|
119
|
+
<h3>Public Class Methods</h3>
|
120
|
+
</header>
|
121
|
+
|
122
|
+
<div id="method-c-new" class="method-detail anchor-link ">
|
123
|
+
<div class="method-header">
|
124
|
+
<div class="method-heading">
|
125
|
+
<a href="#method-c-new" title="Link to this method">
|
126
|
+
<span class="method-name">new</span>
|
127
|
+
<span class="method-args">(filter, order)</span>
|
128
|
+
</a>
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
<div class="method-controls">
|
133
|
+
<details class="method-source-toggle">
|
134
|
+
<summary>Source</summary>
|
135
|
+
</details>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
<div class="method-description">
|
139
|
+
<div class="method-source-code" id="new-source">
|
140
|
+
<pre><span class="ruby-comment"># File lib/models/filter/student_filters/contact_sort_decorator.rb, line 4</span>
|
141
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">filter</span>, <span class="ruby-identifier">order</span>)
|
142
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">filter</span>)
|
143
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">order</span> = <span class="ruby-identifier">order</span>
|
144
|
+
<span class="ruby-keyword">end</span></pre>
|
145
|
+
</div>
|
146
|
+
|
147
|
+
<div class="method-calls-super">
|
148
|
+
Calls superclass method
|
149
|
+
<a href="Filter_decorator.html#method-c-new"><code>Filter_decorator::new</code></a>
|
150
|
+
</div>
|
151
|
+
</div>
|
152
|
+
|
153
|
+
|
154
|
+
</div>
|
155
|
+
|
156
|
+
</section>
|
157
|
+
|
158
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section anchor-link">
|
159
|
+
<header>
|
160
|
+
<h3>Public Instance Methods</h3>
|
161
|
+
</header>
|
162
|
+
|
163
|
+
<div id="method-i-apply" class="method-detail anchor-link ">
|
164
|
+
<div class="method-header">
|
165
|
+
<div class="method-heading">
|
166
|
+
<a href="#method-i-apply" title="Link to this method">
|
167
|
+
<span class="method-name">apply</span>
|
168
|
+
<span class="method-args">(filtering_obj)</span>
|
169
|
+
</a>
|
170
|
+
</div>
|
171
|
+
</div>
|
172
|
+
|
173
|
+
<div class="method-controls">
|
174
|
+
<details class="method-source-toggle">
|
175
|
+
<summary>Source</summary>
|
176
|
+
</details>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
<div class="method-description">
|
180
|
+
<div class="method-source-code" id="apply-source">
|
181
|
+
<pre><span class="ruby-comment"># File lib/models/filter/student_filters/contact_sort_decorator.rb, line 9</span>
|
182
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">apply</span>(<span class="ruby-identifier">filtering_obj</span>)
|
183
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">filtering_obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
|
184
|
+
<span class="ruby-identifier">filtered_students</span> = <span class="ruby-keyword">super</span>(<span class="ruby-identifier">filtering_obj</span>)
|
185
|
+
<span class="ruby-keyword">return</span> [] <span class="ruby-keyword">if</span> <span class="ruby-identifier">filtered_students</span>.<span class="ruby-identifier">nil?</span>
|
186
|
+
|
187
|
+
<span class="ruby-identifier">sorted_students</span> = <span class="ruby-identifier">filtered_students</span>.<span class="ruby-identifier">sort_by</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">student</span><span class="ruby-operator">|</span>
|
188
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_priority</span>(<span class="ruby-identifier">student</span>)
|
189
|
+
<span class="ruby-keyword">end</span>
|
190
|
+
<span class="ruby-identifier">sorted_students</span>.<span class="ruby-identifier">reverse!</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">order</span> <span class="ruby-operator">==</span> <span class="ruby-value">:desc</span>
|
191
|
+
<span class="ruby-identifier">sorted_students</span>
|
192
|
+
<span class="ruby-keyword">else</span>
|
193
|
+
<span class="ruby-identifier">query</span> = <span class="ruby-keyword">super</span>(<span class="ruby-identifier">filtering_obj</span>)
|
194
|
+
<span class="ruby-node">"#{query} ORDER BY
|
195
|
+
CASE
|
196
|
+
WHEN telegram IS NOT NULL AND telegram != '' THEN 1
|
197
|
+
WHEN email IS NOT NULL AND email != '' THEN 2
|
198
|
+
WHEN phone_number IS NOT NULL AND phone_number != '' THEN 3
|
199
|
+
ELSE 4
|
200
|
+
END #{self.order_clause}
|
201
|
+
"</span>
|
202
|
+
<span class="ruby-keyword">end</span>
|
203
|
+
<span class="ruby-keyword">end</span></pre>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<div class="method-calls-super">
|
207
|
+
Calls superclass method
|
208
|
+
<a href="Filter_decorator.html#method-i-apply"><code>Filter_decorator#apply</code></a>
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
</section>
|
216
|
+
|
217
|
+
</section>
|
218
|
+
</main>
|
219
|
+
|
data/doc/DB_client.html
ADDED
@@ -0,0 +1,252 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
7
|
+
|
8
|
+
<title>class DB_client - RDoc Documentation</title>
|
9
|
+
|
10
|
+
<meta name="keywords" content="ruby,class,DB_client">
|
11
|
+
|
12
|
+
<meta name="description" content="Documentation for the DB_client class">
|
13
|
+
|
14
|
+
<script type="text/javascript">
|
15
|
+
var rdoc_rel_prefix = "./";
|
16
|
+
var index_rel_prefix = "./";
|
17
|
+
</script>
|
18
|
+
|
19
|
+
<script src="./js/navigation.js" defer></script>
|
20
|
+
<script src="./js/search.js" defer></script>
|
21
|
+
<script src="./js/search_index.js" defer></script>
|
22
|
+
<script src="./js/searcher.js" defer></script>
|
23
|
+
<script src="./js/darkfish.js" defer></script>
|
24
|
+
|
25
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
26
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
27
|
+
|
28
|
+
|
29
|
+
<body id="top" role="document" class="class">
|
30
|
+
<div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
|
31
|
+
<span aria-hidden="true">☰</span>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
|
35
|
+
<nav id="navigation" role="navigation">
|
36
|
+
<div id="project-navigation">
|
37
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
38
|
+
<h2>
|
39
|
+
<a href="./index.html" rel="home">Home</a>
|
40
|
+
</h2>
|
41
|
+
|
42
|
+
<div id="table-of-contents-navigation">
|
43
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
44
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
45
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
50
|
+
<form action="#" method="get" accept-charset="utf-8">
|
51
|
+
<div id="search-field-wrapper">
|
52
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
53
|
+
aria-autocomplete="list" aria-controls="search-results"
|
54
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
55
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
56
|
+
</div>
|
57
|
+
|
58
|
+
<ul id="search-results" aria-label="Search Results"
|
59
|
+
aria-busy="false" aria-expanded="false"
|
60
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
61
|
+
</form>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
</div>
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
<div id="parent-class-section" class="nav-section">
|
69
|
+
<h3>Ancestors</h3>
|
70
|
+
<ul><li>Object</li></ul>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
<div class="nav-section">
|
77
|
+
<h3>Class Methods</h3>
|
78
|
+
<ul class="link-list" role="directory">
|
79
|
+
<li ><a href="#method-c-instance">instance</a></li>
|
80
|
+
<li ><a href="#method-c-new">new</a></li>
|
81
|
+
</ul>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
<div class="nav-section">
|
87
|
+
<h3>Instance Methods</h3>
|
88
|
+
<ul class="link-list" role="directory">
|
89
|
+
<li ><a href="#method-i-close">close</a></li>
|
90
|
+
<li ><a href="#method-i-query">query</a></li>
|
91
|
+
</ul>
|
92
|
+
</div>
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<footer id="validator-badges" role="contentinfo">
|
97
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
98
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.8.1.
|
99
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
100
|
+
</footer>
|
101
|
+
|
102
|
+
</nav>
|
103
|
+
|
104
|
+
<main role="main" aria-labelledby="class-DB_client">
|
105
|
+
<h1 id="class-DB_client" class="anchor-link class">
|
106
|
+
class DB_client
|
107
|
+
</h1>
|
108
|
+
|
109
|
+
<section class="description">
|
110
|
+
|
111
|
+
</section>
|
112
|
+
|
113
|
+
<section id="5Buntitled-5D" class="documentation-section anchor-link">
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section anchor-link">
|
120
|
+
<header>
|
121
|
+
<h3>Public Class Methods</h3>
|
122
|
+
</header>
|
123
|
+
|
124
|
+
<div id="method-c-instance" class="method-detail anchor-link ">
|
125
|
+
<div class="method-header">
|
126
|
+
<div class="method-heading">
|
127
|
+
<a href="#method-c-instance" title="Link to this method">
|
128
|
+
<span class="method-name">instance</span>
|
129
|
+
<span class="method-args">(db_config = nil)</span>
|
130
|
+
</a>
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
<div class="method-controls">
|
135
|
+
<details class="method-source-toggle">
|
136
|
+
<summary>Source</summary>
|
137
|
+
</details>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<div class="method-description">
|
141
|
+
<div class="method-source-code" id="instance-source">
|
142
|
+
<pre><span class="ruby-comment"># File lib/data_access/DB_client/DB_client.rb, line 11</span>
|
143
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">instance</span>(<span class="ruby-identifier">db_config</span> = <span class="ruby-keyword">nil</span>)
|
144
|
+
<span class="ruby-ivar">@instance</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">new</span>(<span class="ruby-identifier">db_config</span>)
|
145
|
+
<span class="ruby-keyword">end</span></pre>
|
146
|
+
</div>
|
147
|
+
|
148
|
+
</div>
|
149
|
+
|
150
|
+
|
151
|
+
</div>
|
152
|
+
|
153
|
+
<div id="method-c-new" class="method-detail anchor-link ">
|
154
|
+
<div class="method-header">
|
155
|
+
<div class="method-heading">
|
156
|
+
<a href="#method-c-new" title="Link to this method">
|
157
|
+
<span class="method-name">new</span>
|
158
|
+
<span class="method-args">(db_config)</span>
|
159
|
+
</a>
|
160
|
+
</div>
|
161
|
+
</div>
|
162
|
+
|
163
|
+
<div class="method-controls">
|
164
|
+
<details class="method-source-toggle">
|
165
|
+
<summary>Source</summary>
|
166
|
+
</details>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<div class="method-description">
|
170
|
+
<div class="method-source-code" id="new-source">
|
171
|
+
<pre><span class="ruby-comment"># File lib/data_access/DB_client/DB_client.rb, line 6</span>
|
172
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">db_config</span>)
|
173
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">'Database configuration is required'</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">db_config</span>
|
174
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">client</span> = <span class="ruby-constant">Mysql2</span><span class="ruby-operator">::</span><span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">db_config</span>)
|
175
|
+
<span class="ruby-keyword">end</span></pre>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
</div>
|
179
|
+
|
180
|
+
|
181
|
+
</div>
|
182
|
+
|
183
|
+
</section>
|
184
|
+
|
185
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section anchor-link">
|
186
|
+
<header>
|
187
|
+
<h3>Public Instance Methods</h3>
|
188
|
+
</header>
|
189
|
+
|
190
|
+
<div id="method-i-close" class="method-detail anchor-link ">
|
191
|
+
<div class="method-header">
|
192
|
+
<div class="method-heading">
|
193
|
+
<a href="#method-i-close" title="Link to this method">
|
194
|
+
<span class="method-name">close</span>
|
195
|
+
<span class="method-args">()</span>
|
196
|
+
</a>
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
<div class="method-controls">
|
201
|
+
<details class="method-source-toggle">
|
202
|
+
<summary>Source</summary>
|
203
|
+
</details>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<div class="method-description">
|
207
|
+
<div class="method-source-code" id="close-source">
|
208
|
+
<pre><span class="ruby-comment"># File lib/data_access/DB_client/DB_client.rb, line 19</span>
|
209
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">close</span>
|
210
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span>
|
211
|
+
<span class="ruby-keyword">end</span></pre>
|
212
|
+
</div>
|
213
|
+
|
214
|
+
</div>
|
215
|
+
|
216
|
+
|
217
|
+
</div>
|
218
|
+
|
219
|
+
<div id="method-i-query" class="method-detail anchor-link ">
|
220
|
+
<div class="method-header">
|
221
|
+
<div class="method-heading">
|
222
|
+
<a href="#method-i-query" title="Link to this method">
|
223
|
+
<span class="method-name">query</span>
|
224
|
+
<span class="method-args">(query, params=[])</span>
|
225
|
+
</a>
|
226
|
+
</div>
|
227
|
+
</div>
|
228
|
+
|
229
|
+
<div class="method-controls">
|
230
|
+
<details class="method-source-toggle">
|
231
|
+
<summary>Source</summary>
|
232
|
+
</details>
|
233
|
+
</div>
|
234
|
+
|
235
|
+
<div class="method-description">
|
236
|
+
<div class="method-source-code" id="query-source">
|
237
|
+
<pre><span class="ruby-comment"># File lib/data_access/DB_client/DB_client.rb, line 15</span>
|
238
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">query</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">params</span>=[])
|
239
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">client</span>.<span class="ruby-identifier">prepare</span>(<span class="ruby-identifier">query</span>).<span class="ruby-identifier">execute</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">params</span>)
|
240
|
+
<span class="ruby-keyword">end</span></pre>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
</div>
|
244
|
+
|
245
|
+
|
246
|
+
</div>
|
247
|
+
|
248
|
+
</section>
|
249
|
+
|
250
|
+
</section>
|
251
|
+
</main>
|
252
|
+
|