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
data/doc/Deep_dup.html
ADDED
@@ -0,0 +1,152 @@
|
|
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>module Deep_dup - RDoc Documentation</title>
|
9
|
+
|
10
|
+
<meta name="keywords" content="ruby,module,Deep_dup">
|
11
|
+
|
12
|
+
<meta name="description" content="Documentation for the Deep_dup module">
|
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="module">
|
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
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
<div class="nav-section">
|
75
|
+
<h3>Instance Methods</h3>
|
76
|
+
<ul class="link-list" role="directory">
|
77
|
+
<li ><a href="#method-i-deep_dup">deep_dup</a></li>
|
78
|
+
</ul>
|
79
|
+
</div>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
<footer id="validator-badges" role="contentinfo">
|
84
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
85
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.8.1.
|
86
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
87
|
+
</footer>
|
88
|
+
|
89
|
+
</nav>
|
90
|
+
|
91
|
+
<main role="main" aria-labelledby="module-Deep_dup">
|
92
|
+
<h1 id="module-Deep_dup" class="anchor-link module">
|
93
|
+
module Deep_dup
|
94
|
+
</h1>
|
95
|
+
|
96
|
+
<section class="description">
|
97
|
+
|
98
|
+
</section>
|
99
|
+
|
100
|
+
<section id="5Buntitled-5D" class="documentation-section anchor-link">
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section anchor-link">
|
107
|
+
<header>
|
108
|
+
<h3>Public Instance Methods</h3>
|
109
|
+
</header>
|
110
|
+
|
111
|
+
<div id="method-i-deep_dup" class="method-detail anchor-link ">
|
112
|
+
<div class="method-header">
|
113
|
+
<div class="method-heading">
|
114
|
+
<a href="#method-i-deep_dup" title="Link to this method">
|
115
|
+
<span class="method-name">deep_dup</span>
|
116
|
+
<span class="method-args">(element)</span>
|
117
|
+
</a>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
|
121
|
+
<div class="method-controls">
|
122
|
+
<details class="method-source-toggle">
|
123
|
+
<summary>Source</summary>
|
124
|
+
</details>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<div class="method-description">
|
128
|
+
<div class="method-source-code" id="deep_dup-source">
|
129
|
+
<pre><span class="ruby-comment"># File lib/deep_dup/deep_dup.rb, line 3</span>
|
130
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">deep_dup</span>(<span class="ruby-identifier">element</span>)
|
131
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">element</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
|
132
|
+
<span class="ruby-identifier">element</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">sub_element</span><span class="ruby-operator">|</span> <span class="ruby-identifier">deep_dup</span>(<span class="ruby-identifier">sub_element</span>) }
|
133
|
+
<span class="ruby-keyword">else</span>
|
134
|
+
<span class="ruby-keyword">begin</span>
|
135
|
+
<span class="ruby-identifier">element</span>.<span class="ruby-identifier">dup</span>
|
136
|
+
<span class="ruby-keyword">rescue</span>
|
137
|
+
<span class="ruby-identifier">element</span>
|
138
|
+
<span class="ruby-keyword">end</span>
|
139
|
+
<span class="ruby-keyword">end</span>
|
140
|
+
<span class="ruby-keyword">end</span></pre>
|
141
|
+
</div>
|
142
|
+
<p>deep copy</p>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
</div>
|
147
|
+
|
148
|
+
</section>
|
149
|
+
|
150
|
+
</section>
|
151
|
+
</main>
|
152
|
+
|
@@ -0,0 +1,199 @@
|
|
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 Edit_contacts_presenter - RDoc Documentation</title>
|
9
|
+
|
10
|
+
<meta name="keywords" content="ruby,class,Edit_contacts_presenter">
|
11
|
+
|
12
|
+
<meta name="description" content="class Edit_contacts_presenter: Edit_contacts_presenter Презентер для редактирования контактной информации студента.">
|
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="Edit_student_presenter.html">Edit_student_presenter</a><ul><li>Object</li></ul></li></ul>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
<div class="nav-section">
|
79
|
+
<h3>Instance Methods</h3>
|
80
|
+
<ul class="link-list" role="directory">
|
81
|
+
<li ><a href="#method-i-populate_fields">populate_fields</a></li>
|
82
|
+
<li ><a href="#method-i-valid_data-3F">valid_data?</a></li>
|
83
|
+
</ul>
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
<footer id="validator-badges" role="contentinfo">
|
89
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
90
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.8.1.
|
91
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
92
|
+
</footer>
|
93
|
+
|
94
|
+
</nav>
|
95
|
+
|
96
|
+
<main role="main" aria-labelledby="class-Edit_contacts_presenter">
|
97
|
+
<h1 id="class-Edit_contacts_presenter" class="anchor-link class">
|
98
|
+
class Edit_contacts_presenter
|
99
|
+
</h1>
|
100
|
+
|
101
|
+
<section class="description">
|
102
|
+
|
103
|
+
<h2 id="class-Edit_contacts_presenter-label-Edit_contacts_presenter"><a href="Edit_contacts_presenter.html"><code>Edit_contacts_presenter</code></a><span><a href="#class-Edit_contacts_presenter-label-Edit_contacts_presenter">¶</a> <a href="#top">↑</a></span></h2>
|
104
|
+
|
105
|
+
<p>Презентер для редактирования контактной информации студента.</p>
|
106
|
+
|
107
|
+
</section>
|
108
|
+
|
109
|
+
<section id="5Buntitled-5D" class="documentation-section anchor-link">
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section anchor-link">
|
116
|
+
<header>
|
117
|
+
<h3>Public Instance Methods</h3>
|
118
|
+
</header>
|
119
|
+
|
120
|
+
<div id="method-i-populate_fields" class="method-detail anchor-link ">
|
121
|
+
<div class="method-header">
|
122
|
+
<div class="method-heading">
|
123
|
+
<a href="#method-i-populate_fields" title="Link to this method">
|
124
|
+
<span class="method-name">populate_fields</span>
|
125
|
+
<span class="method-args">()</span>
|
126
|
+
</a>
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div class="method-controls">
|
131
|
+
<details class="method-source-toggle">
|
132
|
+
<summary>Source</summary>
|
133
|
+
</details>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
<div class="method-description">
|
137
|
+
<div class="method-source-code" id="populate_fields-source">
|
138
|
+
<pre><span class="ruby-comment"># File lib/presenters/edit_student/edit_contacts_presenter.rb, line 10</span>
|
139
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">populate_fields</span>
|
140
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_student</span>
|
141
|
+
<span class="ruby-identifier">data</span> = {
|
142
|
+
<span class="ruby-string">"telegram"</span> <span class="ruby-operator">=></span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">student</span>.<span class="ruby-identifier">telegram</span>,
|
143
|
+
<span class="ruby-string">"email"</span> <span class="ruby-operator">=></span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">student</span>.<span class="ruby-identifier">email</span>,
|
144
|
+
<span class="ruby-string">"phone_number"</span> <span class="ruby-operator">=></span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">student</span>.<span class="ruby-identifier">phone_number</span>,
|
145
|
+
}
|
146
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">view</span>.<span class="ruby-identifier">update_view</span> <span class="ruby-identifier">data</span>
|
147
|
+
<span class="ruby-keyword">end</span></pre>
|
148
|
+
</div>
|
149
|
+
<p>Заполнение полей интерфейса текущими контактами студента.</p>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
|
153
|
+
</div>
|
154
|
+
|
155
|
+
<div id="method-i-valid_data-3F" class="method-detail anchor-link ">
|
156
|
+
<div class="method-header">
|
157
|
+
<div class="method-heading">
|
158
|
+
<a href="#method-i-valid_data-3F" title="Link to this method">
|
159
|
+
<span class="method-name">valid_data?</span>
|
160
|
+
<span class="method-args">(student_data)</span>
|
161
|
+
</a>
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div class="method-controls">
|
166
|
+
<details class="method-source-toggle">
|
167
|
+
<summary>Source</summary>
|
168
|
+
</details>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
<div class="method-description">
|
172
|
+
<div class="method-source-code" id="valid_data-3F-source">
|
173
|
+
<pre><span class="ruby-comment"># File lib/presenters/edit_student/edit_contacts_presenter.rb, line 24</span>
|
174
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">valid_data?</span>(<span class="ruby-identifier">student_data</span>)
|
175
|
+
<span class="ruby-identifier">data</span> = <span class="ruby-identifier">student_data</span>.<span class="ruby-identifier">transform_values</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">strip</span> }
|
176
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">"Проверка валидности данных: #{data.to_s}"</span>
|
177
|
+
<span class="ruby-identifier">valid</span> = <span class="ruby-constant">Student</span>.<span class="ruby-identifier">valid_phone_number?</span>(<span class="ruby-identifier">data</span>[<span class="ruby-string">"phone_number"</span>]) <span class="ruby-operator">&&</span> <span class="ruby-constant">Student</span>.<span class="ruby-identifier">valid_email?</span>(<span class="ruby-identifier">data</span>[<span class="ruby-string">"email"</span>]) <span class="ruby-operator">&&</span>
|
178
|
+
<span class="ruby-constant">Student</span>.<span class="ruby-identifier">valid_telegram?</span>(<span class="ruby-identifier">data</span>[<span class="ruby-string">"telegram"</span>])
|
179
|
+
<span class="ruby-identifier">unchanged</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">student</span>.<span class="ruby-identifier">telegram</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">data</span>[<span class="ruby-string">"telegram"</span>] <span class="ruby-operator">&&</span>
|
180
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">student</span>.<span class="ruby-identifier">email</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">data</span>[<span class="ruby-string">"email"</span>] <span class="ruby-operator">&&</span>
|
181
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">student</span>.<span class="ruby-identifier">phone_number</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">data</span>[<span class="ruby-string">"phone_number"</span>]
|
182
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">valid</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">unchanged</span>
|
183
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"Валидность данных: #{res}"</span>
|
184
|
+
<span class="ruby-identifier">res</span>
|
185
|
+
<span class="ruby-keyword">end</span></pre>
|
186
|
+
</div>
|
187
|
+
<p>Проверка валидности контактных данных студента.</p>
|
188
|
+
|
189
|
+
<p>@param student_data [Hash] Контактные данные студента. @return [Boolean] Возвращает true, если данные валидны.</p>
|
190
|
+
</div>
|
191
|
+
|
192
|
+
|
193
|
+
</div>
|
194
|
+
|
195
|
+
</section>
|
196
|
+
|
197
|
+
</section>
|
198
|
+
</main>
|
199
|
+
|
@@ -0,0 +1,192 @@
|
|
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 Edit_git_presenter - RDoc Documentation</title>
|
9
|
+
|
10
|
+
<meta name="keywords" content="ruby,class,Edit_git_presenter">
|
11
|
+
|
12
|
+
<meta name="description" content="class Edit_git_presenter: Edit_git_presenter Презентер для редактирования информации о GitHub аккаунте студента.">
|
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="Edit_student_presenter.html">Edit_student_presenter</a><ul><li>Object</li></ul></li></ul>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
<div class="nav-section">
|
79
|
+
<h3>Instance Methods</h3>
|
80
|
+
<ul class="link-list" role="directory">
|
81
|
+
<li ><a href="#method-i-populate_fields">populate_fields</a></li>
|
82
|
+
<li ><a href="#method-i-valid_data-3F">valid_data?</a></li>
|
83
|
+
</ul>
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
<footer id="validator-badges" role="contentinfo">
|
89
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
90
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.8.1.
|
91
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
92
|
+
</footer>
|
93
|
+
|
94
|
+
</nav>
|
95
|
+
|
96
|
+
<main role="main" aria-labelledby="class-Edit_git_presenter">
|
97
|
+
<h1 id="class-Edit_git_presenter" class="anchor-link class">
|
98
|
+
class Edit_git_presenter
|
99
|
+
</h1>
|
100
|
+
|
101
|
+
<section class="description">
|
102
|
+
|
103
|
+
<h2 id="class-Edit_git_presenter-label-Edit_git_presenter"><a href="Edit_git_presenter.html"><code>Edit_git_presenter</code></a><span><a href="#class-Edit_git_presenter-label-Edit_git_presenter">¶</a> <a href="#top">↑</a></span></h2>
|
104
|
+
|
105
|
+
<p>Презентер для редактирования информации о GitHub аккаунте студента.</p>
|
106
|
+
|
107
|
+
</section>
|
108
|
+
|
109
|
+
<section id="5Buntitled-5D" class="documentation-section anchor-link">
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section anchor-link">
|
116
|
+
<header>
|
117
|
+
<h3>Public Instance Methods</h3>
|
118
|
+
</header>
|
119
|
+
|
120
|
+
<div id="method-i-populate_fields" class="method-detail anchor-link ">
|
121
|
+
<div class="method-header">
|
122
|
+
<div class="method-heading">
|
123
|
+
<a href="#method-i-populate_fields" title="Link to this method">
|
124
|
+
<span class="method-name">populate_fields</span>
|
125
|
+
<span class="method-args">()</span>
|
126
|
+
</a>
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div class="method-controls">
|
131
|
+
<details class="method-source-toggle">
|
132
|
+
<summary>Source</summary>
|
133
|
+
</details>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
<div class="method-description">
|
137
|
+
<div class="method-source-code" id="populate_fields-source">
|
138
|
+
<pre><span class="ruby-comment"># File lib/presenters/edit_student/edit_git_presenter.rb, line 9</span>
|
139
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">populate_fields</span>
|
140
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_student</span>
|
141
|
+
<span class="ruby-identifier">data</span> = {
|
142
|
+
<span class="ruby-string">"git"</span> <span class="ruby-operator">=></span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">student</span>.<span class="ruby-identifier">git</span>,
|
143
|
+
}
|
144
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">view</span>.<span class="ruby-identifier">update_view</span> <span class="ruby-identifier">data</span>
|
145
|
+
<span class="ruby-keyword">end</span></pre>
|
146
|
+
</div>
|
147
|
+
<p>Заполнение полей интерфейса текущими данными о Git студента.</p>
|
148
|
+
</div>
|
149
|
+
|
150
|
+
|
151
|
+
</div>
|
152
|
+
|
153
|
+
<div id="method-i-valid_data-3F" class="method-detail anchor-link ">
|
154
|
+
<div class="method-header">
|
155
|
+
<div class="method-heading">
|
156
|
+
<a href="#method-i-valid_data-3F" title="Link to this method">
|
157
|
+
<span class="method-name">valid_data?</span>
|
158
|
+
<span class="method-args">(student_data)</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="valid_data-3F-source">
|
171
|
+
<pre><span class="ruby-comment"># File lib/presenters/edit_student/edit_git_presenter.rb, line 21</span>
|
172
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">valid_data?</span>(<span class="ruby-identifier">student_data</span>)
|
173
|
+
<span class="ruby-identifier">data</span> = <span class="ruby-identifier">student_data</span>.<span class="ruby-identifier">transform_values</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">strip</span> }
|
174
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">"Проверка валидности данных: #{data.to_s}"</span>
|
175
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-constant">Student</span>.<span class="ruby-identifier">valid_git?</span>(<span class="ruby-identifier">data</span>[<span class="ruby-string">"git"</span>]) <span class="ruby-operator">&&</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">student</span>.<span class="ruby-identifier">git</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">data</span>[<span class="ruby-string">"git"</span>]
|
176
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"Валидность данных: #{res}"</span>
|
177
|
+
<span class="ruby-identifier">res</span>
|
178
|
+
<span class="ruby-keyword">end</span></pre>
|
179
|
+
</div>
|
180
|
+
<p>Проверка валидности данных о Git.</p>
|
181
|
+
|
182
|
+
<p>@param student_data [Hash] Данные о Git. @return [Boolean] Возвращает true, если данные валидны.</p>
|
183
|
+
</div>
|
184
|
+
|
185
|
+
|
186
|
+
</div>
|
187
|
+
|
188
|
+
</section>
|
189
|
+
|
190
|
+
</section>
|
191
|
+
</main>
|
192
|
+
|