student_mvp 0.1.7 → 0.1.9
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/doc/App_logger.html +47 -33
- data/doc/DB_client.html +20 -10
- data/doc/created.rid +10 -44
- data/doc/index.html +2 -81
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/table_of_contents.html +9 -697
- data/lib/data_access/DB_client/DB_client.rb +20 -1
- data/lib/logger/logger.rb +36 -1
- data/lib/student_mvp/version.rb +1 -1
- metadata +55 -34
- data/doc/Binary_tree.html +0 -300
- data/doc/Binary_tree_iterator.html +0 -217
- data/doc/Contact_sort_decorator.html +0 -219
- data/doc/Data_list.html +0 -625
- data/doc/Data_list_student_short.html +0 -148
- data/doc/Data_storage_strategy.html +0 -178
- data/doc/Data_table.html +0 -264
- data/doc/Deep_dup.html +0 -152
- data/doc/Field_filter_decorator.html +0 -219
- data/doc/Filter.html +0 -148
- data/doc/Filter_decorator.html +0 -209
- data/doc/Full_name_filter_decorator.html +0 -211
- data/doc/Full_name_sort_decorator.html +0 -217
- data/doc/Gemfile.html +0 -98
- data/doc/Git_sort_decorator.html +0 -220
- data/doc/Has_not_field_filter_decorator.html +0 -209
- data/doc/JSON_storage_strategy.html +0 -183
- data/doc/Person.html +0 -511
- data/doc/README_md.html +0 -147
- data/doc/Rakefile.html +0 -94
- data/doc/Sort_decorator.html +0 -214
- data/doc/Student.html +0 -755
- data/doc/StudentMvp/Error.html +0 -105
- data/doc/StudentMvp.html +0 -111
- data/doc/Student_short.html +0 -398
- data/doc/Students_list.html +0 -341
- data/doc/Students_list_DB.html +0 -361
- data/doc/Students_list_file.html +0 -460
- data/doc/Students_list_file_adapter.html +0 -341
- data/doc/Students_list_interface.html +0 -298
- data/doc/YAML_storage_strategy.html +0 -183
- data/doc/bin/setup.html +0 -96
data/doc/Filter_decorator.html
DELETED
@@ -1,209 +0,0 @@
|
|
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 Filter_decorator - RDoc Documentation</title>
|
9
|
-
|
10
|
-
<meta name="keywords" content="ruby,class,Filter_decorator">
|
11
|
-
|
12
|
-
<meta name="description" content="Documentation for the Filter_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.html">Filter</a><ul><li>Object</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 ><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 ><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-Filter_decorator">
|
103
|
-
<h1 id="class-Filter_decorator" class="anchor-link class">
|
104
|
-
class Filter_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
|
-
<section class="attribute-method-details" class="method-section">
|
116
|
-
<header>
|
117
|
-
<h3>Attributes</h3>
|
118
|
-
</header>
|
119
|
-
|
120
|
-
<div id="attribute-i-filter" class="method-detail anchor-link">
|
121
|
-
<div class="method-heading attribute-method-heading">
|
122
|
-
<a href="#attribute-i-filter" title="Link to this attribute">
|
123
|
-
<span class="method-name">filter</span>
|
124
|
-
<span class="attribute-access-type">[RW]</span>
|
125
|
-
</a>
|
126
|
-
</div>
|
127
|
-
|
128
|
-
<div class="method-description">
|
129
|
-
|
130
|
-
</div>
|
131
|
-
</div>
|
132
|
-
</section>
|
133
|
-
|
134
|
-
|
135
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section anchor-link">
|
136
|
-
<header>
|
137
|
-
<h3>Public Class Methods</h3>
|
138
|
-
</header>
|
139
|
-
|
140
|
-
<div id="method-c-new" class="method-detail anchor-link ">
|
141
|
-
<div class="method-header">
|
142
|
-
<div class="method-heading">
|
143
|
-
<a href="#method-c-new" title="Link to this method">
|
144
|
-
<span class="method-name">new</span>
|
145
|
-
<span class="method-args">(filter)</span>
|
146
|
-
</a>
|
147
|
-
</div>
|
148
|
-
</div>
|
149
|
-
|
150
|
-
<div class="method-controls">
|
151
|
-
<details class="method-source-toggle">
|
152
|
-
<summary>Source</summary>
|
153
|
-
</details>
|
154
|
-
</div>
|
155
|
-
|
156
|
-
<div class="method-description">
|
157
|
-
<div class="method-source-code" id="new-source">
|
158
|
-
<pre><span class="ruby-comment"># File lib/models/filter/filter_decorator.rb, line 4</span>
|
159
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">filter</span>)
|
160
|
-
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">filter</span> = <span class="ruby-identifier">filter</span>
|
161
|
-
<span class="ruby-keyword">end</span></pre>
|
162
|
-
</div>
|
163
|
-
|
164
|
-
</div>
|
165
|
-
|
166
|
-
|
167
|
-
</div>
|
168
|
-
|
169
|
-
</section>
|
170
|
-
|
171
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section anchor-link">
|
172
|
-
<header>
|
173
|
-
<h3>Public Instance Methods</h3>
|
174
|
-
</header>
|
175
|
-
|
176
|
-
<div id="method-i-apply" class="method-detail anchor-link ">
|
177
|
-
<div class="method-header">
|
178
|
-
<div class="method-heading">
|
179
|
-
<a href="#method-i-apply" title="Link to this method">
|
180
|
-
<span class="method-name">apply</span>
|
181
|
-
<span class="method-args">(filtering_obj)</span>
|
182
|
-
</a>
|
183
|
-
</div>
|
184
|
-
</div>
|
185
|
-
|
186
|
-
<div class="method-controls">
|
187
|
-
<details class="method-source-toggle">
|
188
|
-
<summary>Source</summary>
|
189
|
-
</details>
|
190
|
-
</div>
|
191
|
-
|
192
|
-
<div class="method-description">
|
193
|
-
<div class="method-source-code" id="apply-source">
|
194
|
-
<pre><span class="ruby-comment"># File lib/models/filter/filter_decorator.rb, line 8</span>
|
195
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">apply</span>(<span class="ruby-identifier">filtering_obj</span>)
|
196
|
-
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">filter</span>.<span class="ruby-identifier">apply</span>(<span class="ruby-identifier">filtering_obj</span>)
|
197
|
-
<span class="ruby-keyword">end</span></pre>
|
198
|
-
</div>
|
199
|
-
|
200
|
-
</div>
|
201
|
-
|
202
|
-
|
203
|
-
</div>
|
204
|
-
|
205
|
-
</section>
|
206
|
-
|
207
|
-
</section>
|
208
|
-
</main>
|
209
|
-
|
@@ -1,211 +0,0 @@
|
|
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 Full_name_filter_decorator - RDoc Documentation</title>
|
9
|
-
|
10
|
-
<meta name="keywords" content="ruby,class,Full_name_filter_decorator">
|
11
|
-
|
12
|
-
<meta name="description" content="Documentation for the Full_name_filter_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-Full_name_filter_decorator">
|
103
|
-
<h1 id="class-Full_name_filter_decorator" class="anchor-link class">
|
104
|
-
class Full_name_filter_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, full_name)</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/full_name_filter_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">full_name</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">full_name</span> = <span class="ruby-identifier">full_name</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">full_name</span>.<span class="ruby-identifier">nil?</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/full_name_filter_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">return</span> <span class="ruby-keyword">super</span>(<span class="ruby-identifier">filtering_obj</span>) <span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">full_name</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">full_name</span>.<span class="ruby-identifier">empty?</span>
|
184
|
-
|
185
|
-
<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>)
|
186
|
-
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">filtering_obj</span>).<span class="ruby-identifier">select</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">student</span><span class="ruby-operator">|</span>
|
187
|
-
<span class="ruby-identifier">initials</span> = <span class="ruby-node">"#{student.get_full_name}"</span>
|
188
|
-
<span class="ruby-identifier">initials</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">full_name</span>)
|
189
|
-
<span class="ruby-keyword">end</span>
|
190
|
-
<span class="ruby-keyword">else</span>
|
191
|
-
<span class="ruby-identifier">query</span> = <span class="ruby-keyword">super</span>(<span class="ruby-identifier">filtering_obj</span>)
|
192
|
-
<span class="ruby-identifier">condition</span> = <span class="ruby-identifier">query</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">"WHERE"</span>) <span class="ruby-operator">?</span> <span class="ruby-string">"AND"</span> <span class="ruby-operator">:</span> <span class="ruby-string">"WHERE"</span>
|
193
|
-
<span class="ruby-node">"#{query} #{condition} CONCAT(LOWER(first_name), ' ', LOWER(LEFT(name, 1)), '.', LOWER(LEFT(patronymic, 1)), '.') LIKE '%#{self.full_name}%'"</span>
|
194
|
-
<span class="ruby-keyword">end</span>
|
195
|
-
<span class="ruby-keyword">end</span></pre>
|
196
|
-
</div>
|
197
|
-
|
198
|
-
<div class="method-calls-super">
|
199
|
-
Calls superclass method
|
200
|
-
<a href="Filter_decorator.html#method-i-apply"><code>Filter_decorator#apply</code></a>
|
201
|
-
</div>
|
202
|
-
</div>
|
203
|
-
|
204
|
-
|
205
|
-
</div>
|
206
|
-
|
207
|
-
</section>
|
208
|
-
|
209
|
-
</section>
|
210
|
-
</main>
|
211
|
-
|
@@ -1,217 +0,0 @@
|
|
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 Full_name_sort_decorator - RDoc Documentation</title>
|
9
|
-
|
10
|
-
<meta name="keywords" content="ruby,class,Full_name_sort_decorator">
|
11
|
-
|
12
|
-
<meta name="description" content="Documentation for the Full_name_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-Full_name_sort_decorator">
|
103
|
-
<h1 id="class-Full_name_sort_decorator" class="anchor-link class">
|
104
|
-
class Full_name_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/full_name_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/full_name_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
|
-
|
186
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">filtered_students</span>.<span class="ruby-identifier">nil?</span>
|
187
|
-
<span class="ruby-keyword">return</span> []
|
188
|
-
<span class="ruby-keyword">end</span>
|
189
|
-
|
190
|
-
<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>
|
191
|
-
<span class="ruby-node">"#{student.first_name} #{student.name} #{student.patronymic}"</span>.<span class="ruby-identifier">downcase</span>
|
192
|
-
<span class="ruby-keyword">end</span>
|
193
|
-
|
194
|
-
<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>
|
195
|
-
|
196
|
-
<span class="ruby-keyword">return</span> <span class="ruby-identifier">sorted_students</span>
|
197
|
-
<span class="ruby-keyword">else</span>
|
198
|
-
<span class="ruby-identifier">query</span> = <span class="ruby-keyword">super</span>(<span class="ruby-identifier">filtering_obj</span>)
|
199
|
-
<span class="ruby-node">"#{query} ORDER BY CONCAT(first_name, ' ', name, ' ', patronymic) #{self.order == :asc ? 'ASC' : 'DESC'}"</span>
|
200
|
-
<span class="ruby-keyword">end</span>
|
201
|
-
<span class="ruby-keyword">end</span></pre>
|
202
|
-
</div>
|
203
|
-
|
204
|
-
<div class="method-calls-super">
|
205
|
-
Calls superclass method
|
206
|
-
<a href="Filter_decorator.html#method-i-apply"><code>Filter_decorator#apply</code></a>
|
207
|
-
</div>
|
208
|
-
</div>
|
209
|
-
|
210
|
-
|
211
|
-
</div>
|
212
|
-
|
213
|
-
</section>
|
214
|
-
|
215
|
-
</section>
|
216
|
-
</main>
|
217
|
-
|