apes 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +7 -0
- data/.rubocop.yml +82 -0
- data/.travis-gemfile +15 -0
- data/.travis.yml +15 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +22 -0
- data/README.md +177 -0
- data/Rakefile +44 -0
- data/apes.gemspec +34 -0
- data/doc/Apes.html +130 -0
- data/doc/Apes/Concerns.html +127 -0
- data/doc/Apes/Concerns/Errors.html +1089 -0
- data/doc/Apes/Concerns/Pagination.html +636 -0
- data/doc/Apes/Concerns/Request.html +766 -0
- data/doc/Apes/Concerns/Response.html +940 -0
- data/doc/Apes/Controller.html +1100 -0
- data/doc/Apes/Errors.html +125 -0
- data/doc/Apes/Errors/AuthenticationError.html +133 -0
- data/doc/Apes/Errors/BadRequestError.html +157 -0
- data/doc/Apes/Errors/BaseError.html +320 -0
- data/doc/Apes/Errors/InvalidDataError.html +157 -0
- data/doc/Apes/Errors/MissingDataError.html +157 -0
- data/doc/Apes/Model.html +378 -0
- data/doc/Apes/PaginationCursor.html +2138 -0
- data/doc/Apes/RuntimeConfiguration.html +909 -0
- data/doc/Apes/Serializers.html +125 -0
- data/doc/Apes/Serializers/JSON.html +389 -0
- data/doc/Apes/Serializers/JWT.html +452 -0
- data/doc/Apes/Serializers/List.html +347 -0
- data/doc/Apes/UrlsParser.html +1432 -0
- data/doc/Apes/Validators.html +125 -0
- data/doc/Apes/Validators/BaseValidator.html +278 -0
- data/doc/Apes/Validators/BooleanValidator.html +494 -0
- data/doc/Apes/Validators/EmailValidator.html +350 -0
- data/doc/Apes/Validators/PhoneValidator.html +375 -0
- data/doc/Apes/Validators/ReferenceValidator.html +372 -0
- data/doc/Apes/Validators/TimestampValidator.html +640 -0
- data/doc/Apes/Validators/UuidValidator.html +372 -0
- data/doc/Apes/Validators/ZipCodeValidator.html +372 -0
- data/doc/Apes/Version.html +189 -0
- data/doc/ApplicationController.html +547 -0
- data/doc/Concerns.html +128 -0
- data/doc/Concerns/ErrorHandling.html +826 -0
- data/doc/Concerns/PaginationHandling.html +463 -0
- data/doc/Concerns/RequestHandling.html +512 -0
- data/doc/Concerns/ResponseHandling.html +579 -0
- data/doc/Errors.html +126 -0
- data/doc/Errors/AuthenticationError.html +123 -0
- data/doc/Errors/BadRequestError.html +147 -0
- data/doc/Errors/BaseError.html +289 -0
- data/doc/Errors/InvalidDataError.html +147 -0
- data/doc/Errors/MissingDataError.html +147 -0
- data/doc/Model.html +315 -0
- data/doc/PaginationCursor.html +764 -0
- data/doc/Serializers.html +126 -0
- data/doc/Serializers/JSON.html +253 -0
- data/doc/Serializers/JWT.html +253 -0
- data/doc/Serializers/List.html +245 -0
- data/doc/Validators.html +126 -0
- data/doc/Validators/BaseValidator.html +209 -0
- data/doc/Validators/BooleanValidator.html +391 -0
- data/doc/Validators/EmailValidator.html +298 -0
- data/doc/Validators/PhoneValidator.html +313 -0
- data/doc/Validators/ReferenceValidator.html +284 -0
- data/doc/Validators/TimestampValidator.html +476 -0
- data/doc/Validators/UuidValidator.html +310 -0
- data/doc/Validators/ZipCodeValidator.html +310 -0
- data/doc/_index.html +435 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +252 -0
- data/doc/file_list.html +60 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +252 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +615 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/apes.rb +40 -0
- data/lib/apes/concerns/errors.rb +111 -0
- data/lib/apes/concerns/pagination.rb +81 -0
- data/lib/apes/concerns/request.rb +237 -0
- data/lib/apes/concerns/response.rb +74 -0
- data/lib/apes/controller.rb +77 -0
- data/lib/apes/errors.rb +38 -0
- data/lib/apes/model.rb +94 -0
- data/lib/apes/pagination_cursor.rb +152 -0
- data/lib/apes/runtime_configuration.rb +80 -0
- data/lib/apes/serializers.rb +88 -0
- data/lib/apes/urls_parser.rb +233 -0
- data/lib/apes/validators.rb +234 -0
- data/lib/apes/version.rb +24 -0
- data/spec/apes/concerns/errors_spec.rb +141 -0
- data/spec/apes/concerns/pagination_spec.rb +114 -0
- data/spec/apes/concerns/request_spec.rb +244 -0
- data/spec/apes/concerns/response_spec.rb +79 -0
- data/spec/apes/controller_spec.rb +54 -0
- data/spec/apes/errors_spec.rb +14 -0
- data/spec/apes/models_spec.rb +148 -0
- data/spec/apes/pagination_cursor_spec.rb +113 -0
- data/spec/apes/runtime_configuration_spec.rb +100 -0
- data/spec/apes/serializers_spec.rb +70 -0
- data/spec/apes/urls_parser_spec.rb +150 -0
- data/spec/apes/validators_spec.rb +237 -0
- data/spec/spec_helper.rb +30 -0
- data/views/_included.json.jbuilder +9 -0
- data/views/_pagination.json.jbuilder +9 -0
- data/views/collection.json.jbuilder +4 -0
- data/views/errors/400.json.jbuilder +9 -0
- data/views/errors/403.json.jbuilder +7 -0
- data/views/errors/404.json.jbuilder +6 -0
- data/views/errors/422.json.jbuilder +19 -0
- data/views/errors/500.json.jbuilder +12 -0
- data/views/errors/501.json.jbuilder +7 -0
- data/views/layouts/general.json.jbuilder +36 -0
- data/views/object.json.jbuilder +4 -0
- metadata +262 -0
data/doc/Concerns.html
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Concerns
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '';
|
20
|
+
framesUrl = "frames.html#!Concerns.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="_index.html">Index (C)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">Concerns</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Concerns
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/apes/concerns/errors.rb<span class="defines">,<br />
|
83
|
+
lib/apes/concerns/request.rb,<br /> lib/apes/concerns/response.rb,<br /> lib/apes/concerns/pagination.rb</span>
|
84
|
+
</dd>
|
85
|
+
|
86
|
+
</dl>
|
87
|
+
<div class="clear"></div>
|
88
|
+
|
89
|
+
<h2>Overview</h2><div class="docstring">
|
90
|
+
<div class="discussion">
|
91
|
+
<p>This file is part of the apes gem. Copyright (C) 2016 and above Shogun <a href="mailto:shogun@cowtech.it">shogun@cowtech.it</a>.
|
92
|
+
Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.</p>
|
93
|
+
|
94
|
+
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
<div class="tags">
|
98
|
+
|
99
|
+
|
100
|
+
</div><h2>Defined Under Namespace</h2>
|
101
|
+
<p class="children">
|
102
|
+
|
103
|
+
|
104
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Concerns/ErrorHandling.html" title="Concerns::ErrorHandling (module)">ErrorHandling</a></span>, <span class='object_link'><a href="Concerns/PaginationHandling.html" title="Concerns::PaginationHandling (module)">PaginationHandling</a></span>, <span class='object_link'><a href="Concerns/RequestHandling.html" title="Concerns::RequestHandling (module)">RequestHandling</a></span>, <span class='object_link'><a href="Concerns/ResponseHandling.html" title="Concerns::ResponseHandling (module)">ResponseHandling</a></span>
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
</p>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
<div id="footer">
|
122
|
+
Generated on Sat May 21 11:01:51 2016 by
|
123
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
124
|
+
0.8.7.6 (ruby-2.3.0).
|
125
|
+
</div>
|
126
|
+
|
127
|
+
</body>
|
128
|
+
</html>
|
@@ -0,0 +1,826 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Concerns::ErrorHandling
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!Concerns/ErrorHandling.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (E)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Concerns.html" title="Concerns (module)">Concerns</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">ErrorHandling</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Concerns::ErrorHandling
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/apes/concerns/errors.rb</dd>
|
83
|
+
|
84
|
+
</dl>
|
85
|
+
<div class="clear"></div>
|
86
|
+
|
87
|
+
|
88
|
+
<h2>Constant Summary</h2>
|
89
|
+
|
90
|
+
<dl class="constants">
|
91
|
+
|
92
|
+
<dt id="ERROR_HANDLERS-constant" class="">ERROR_HANDLERS =
|
93
|
+
|
94
|
+
</dt>
|
95
|
+
<dd><pre class="code"><span class='lbrace'>{</span>
|
96
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ActiveRecord::RecordNotFound</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:error_handle_not_found</span><span class='comma'>,</span>
|
97
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Errors::AuthenticationError</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:error_handle_fordidden</span><span class='comma'>,</span>
|
98
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Errors::InvalidModelError</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:error_handle_invalid_source</span><span class='comma'>,</span>
|
99
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Errors::BadRequestError</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:error_handle_bad_request</span><span class='comma'>,</span>
|
100
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Errors::MissingDataError</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:error_handle_missing_data</span><span class='comma'>,</span>
|
101
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Errors::InvalidDataError</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:error_handle_invalid_data</span><span class='comma'>,</span>
|
102
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>JSON::ParserError</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:error_handle_invalid_data</span><span class='comma'>,</span>
|
103
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ActiveRecord::RecordInvalid</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:error_handle_validation</span><span class='comma'>,</span>
|
104
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ActiveRecord::UnknownAttributeError</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:error_handle_unknown_attribute</span><span class='comma'>,</span>
|
105
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ActionController::UnpermittedParameters</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:error_handle_unknown_attribute</span><span class='comma'>,</span>
|
106
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Errors::BaseError</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:error_handle_general</span><span class='comma'>,</span>
|
107
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Lazier::Exceptions::Debug</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='symbol'>:error_handle_debug</span>
|
108
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
109
|
+
|
110
|
+
</dl>
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<h2>
|
121
|
+
Instance Method Summary
|
122
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
123
|
+
</h2>
|
124
|
+
|
125
|
+
<ul class="summary">
|
126
|
+
|
127
|
+
<li class="public ">
|
128
|
+
<span class="summary_signature">
|
129
|
+
|
130
|
+
<a href="#error_handle_bad_request-instance_method" title="#error_handle_bad_request (instance method)">- (Object) <strong>error_handle_bad_request</strong>(_ = nil) </a>
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
</span>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<span class="summary_desc"><div class='inline'>
|
145
|
+
</div></span>
|
146
|
+
|
147
|
+
</li>
|
148
|
+
|
149
|
+
|
150
|
+
<li class="public ">
|
151
|
+
<span class="summary_signature">
|
152
|
+
|
153
|
+
<a href="#error_handle_debug-instance_method" title="#error_handle_debug (instance method)">- (Object) <strong>error_handle_debug</strong>(exception) </a>
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
</span>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<span class="summary_desc"><div class='inline'>
|
168
|
+
</div></span>
|
169
|
+
|
170
|
+
</li>
|
171
|
+
|
172
|
+
|
173
|
+
<li class="public ">
|
174
|
+
<span class="summary_signature">
|
175
|
+
|
176
|
+
<a href="#error_handle_exception-instance_method" title="#error_handle_exception (instance method)">- (Object) <strong>error_handle_exception</strong>(exception) </a>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
</span>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
<span class="summary_desc"><div class='inline'>
|
191
|
+
</div></span>
|
192
|
+
|
193
|
+
</li>
|
194
|
+
|
195
|
+
|
196
|
+
<li class="public ">
|
197
|
+
<span class="summary_signature">
|
198
|
+
|
199
|
+
<a href="#error_handle_fordidden-instance_method" title="#error_handle_fordidden (instance method)">- (Object) <strong>error_handle_fordidden</strong>(exception) </a>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
</span>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<span class="summary_desc"><div class='inline'>
|
214
|
+
</div></span>
|
215
|
+
|
216
|
+
</li>
|
217
|
+
|
218
|
+
|
219
|
+
<li class="public ">
|
220
|
+
<span class="summary_signature">
|
221
|
+
|
222
|
+
<a href="#error_handle_general-instance_method" title="#error_handle_general (instance method)">- (Object) <strong>error_handle_general</strong>(exception) </a>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
</span>
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
<span class="summary_desc"><div class='inline'>
|
237
|
+
</div></span>
|
238
|
+
|
239
|
+
</li>
|
240
|
+
|
241
|
+
|
242
|
+
<li class="public ">
|
243
|
+
<span class="summary_signature">
|
244
|
+
|
245
|
+
<a href="#error_handle_invalid_data-instance_method" title="#error_handle_invalid_data (instance method)">- (Object) <strong>error_handle_invalid_data</strong>(_ = nil) </a>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
</span>
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
<span class="summary_desc"><div class='inline'>
|
260
|
+
</div></span>
|
261
|
+
|
262
|
+
</li>
|
263
|
+
|
264
|
+
|
265
|
+
<li class="public ">
|
266
|
+
<span class="summary_signature">
|
267
|
+
|
268
|
+
<a href="#error_handle_missing_data-instance_method" title="#error_handle_missing_data (instance method)">- (Object) <strong>error_handle_missing_data</strong>(_ = nil) </a>
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
</span>
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
<span class="summary_desc"><div class='inline'>
|
283
|
+
</div></span>
|
284
|
+
|
285
|
+
</li>
|
286
|
+
|
287
|
+
|
288
|
+
<li class="public ">
|
289
|
+
<span class="summary_signature">
|
290
|
+
|
291
|
+
<a href="#error_handle_not_found-instance_method" title="#error_handle_not_found (instance method)">- (Object) <strong>error_handle_not_found</strong>(_ = nil) </a>
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
</span>
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
<span class="summary_desc"><div class='inline'>
|
306
|
+
</div></span>
|
307
|
+
|
308
|
+
</li>
|
309
|
+
|
310
|
+
|
311
|
+
<li class="public ">
|
312
|
+
<span class="summary_signature">
|
313
|
+
|
314
|
+
<a href="#error_handle_others-instance_method" title="#error_handle_others (instance method)">- (Object) <strong>error_handle_others</strong>(exception) </a>
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
</span>
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
<span class="summary_desc"><div class='inline'>
|
329
|
+
</div></span>
|
330
|
+
|
331
|
+
</li>
|
332
|
+
|
333
|
+
|
334
|
+
<li class="public ">
|
335
|
+
<span class="summary_signature">
|
336
|
+
|
337
|
+
<a href="#error_handle_unknown_attribute-instance_method" title="#error_handle_unknown_attribute (instance method)">- (Object) <strong>error_handle_unknown_attribute</strong>(exception) </a>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
</span>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
<span class="summary_desc"><div class='inline'>
|
352
|
+
</div></span>
|
353
|
+
|
354
|
+
</li>
|
355
|
+
|
356
|
+
|
357
|
+
<li class="public ">
|
358
|
+
<span class="summary_signature">
|
359
|
+
|
360
|
+
<a href="#error_handle_validation-instance_method" title="#error_handle_validation (instance method)">- (Object) <strong>error_handle_validation</strong>(exception) </a>
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
</span>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
<span class="summary_desc"><div class='inline'>
|
375
|
+
</div></span>
|
376
|
+
|
377
|
+
</li>
|
378
|
+
|
379
|
+
|
380
|
+
<li class="public ">
|
381
|
+
<span class="summary_signature">
|
382
|
+
|
383
|
+
<a href="#fail_request%21-instance_method" title="#fail_request! (instance method)">- (Object) <strong>fail_request!</strong>(status, error) </a>
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
</span>
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
<span class="summary_desc"><div class='inline'>
|
398
|
+
</div></span>
|
399
|
+
|
400
|
+
</li>
|
401
|
+
|
402
|
+
|
403
|
+
</ul>
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
<div id="instance_method_details" class="method_details_list">
|
409
|
+
<h2>Instance Method Details</h2>
|
410
|
+
|
411
|
+
|
412
|
+
<div class="method_details first">
|
413
|
+
<h3 class="signature first" id="error_handle_bad_request-instance_method">
|
414
|
+
|
415
|
+
- (<tt>Object</tt>) <strong>error_handle_bad_request</strong>(_ = nil)
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
</h3><table class="source_code">
|
422
|
+
<tr>
|
423
|
+
<td>
|
424
|
+
<pre class="lines">
|
425
|
+
|
426
|
+
|
427
|
+
56
|
428
|
+
57
|
429
|
+
58
|
430
|
+
59</pre>
|
431
|
+
</td>
|
432
|
+
<td>
|
433
|
+
<pre class="code"><span class="info file"># File 'lib/apes/concerns/errors.rb', line 56</span>
|
434
|
+
|
435
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_handle_bad_request'>error_handle_bad_request</span><span class='lparen'>(</span><span class='id identifier rubyid__'>_</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
436
|
+
<span class='ivar'>@reason</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Invalid Content-Type specified. Please use \"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_request_valid_content_type'>request_valid_content_type</span><span class='embexpr_end'>}</span><span class='tstring_content'>\" when performing write operations.</span><span class='tstring_end'>"</span></span>
|
437
|
+
<span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>errors/400</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>status:</span> <span class='symbol'>:bad_request</span><span class='rparen'>)</span>
|
438
|
+
<span class='kw'>end</span></pre>
|
439
|
+
</td>
|
440
|
+
</tr>
|
441
|
+
</table>
|
442
|
+
</div>
|
443
|
+
|
444
|
+
<div class="method_details ">
|
445
|
+
<h3 class="signature " id="error_handle_debug-instance_method">
|
446
|
+
|
447
|
+
- (<tt>Object</tt>) <strong>error_handle_debug</strong>(exception)
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
</h3><table class="source_code">
|
454
|
+
<tr>
|
455
|
+
<td>
|
456
|
+
<pre class="lines">
|
457
|
+
|
458
|
+
|
459
|
+
43
|
460
|
+
44
|
461
|
+
45</pre>
|
462
|
+
</td>
|
463
|
+
<td>
|
464
|
+
<pre class="code"><span class="info file"># File 'lib/apes/concerns/errors.rb', line 43</span>
|
465
|
+
|
466
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_handle_debug'>error_handle_debug</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
|
467
|
+
<span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>errors/400</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>status:</span> <span class='int'>418</span><span class='comma'>,</span> <span class='label'>locals:</span> <span class='lbrace'>{</span><span class='label'>debug:</span> <span class='const'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
468
|
+
<span class='kw'>end</span></pre>
|
469
|
+
</td>
|
470
|
+
</tr>
|
471
|
+
</table>
|
472
|
+
</div>
|
473
|
+
|
474
|
+
<div class="method_details ">
|
475
|
+
<h3 class="signature " id="error_handle_exception-instance_method">
|
476
|
+
|
477
|
+
- (<tt>Object</tt>) <strong>error_handle_exception</strong>(exception)
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
</h3><table class="source_code">
|
484
|
+
<tr>
|
485
|
+
<td>
|
486
|
+
<pre class="lines">
|
487
|
+
|
488
|
+
|
489
|
+
27
|
490
|
+
28
|
491
|
+
29
|
492
|
+
30</pre>
|
493
|
+
</td>
|
494
|
+
<td>
|
495
|
+
<pre class="code"><span class="info file"># File 'lib/apes/concerns/errors.rb', line 27</span>
|
496
|
+
|
497
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_handle_exception'>error_handle_exception</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
|
498
|
+
<span class='id identifier rubyid_handler'>handler</span> <span class='op'>=</span> <span class='const'>ERROR_HANDLERS</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='symbol'>:error_handle_others</span><span class='rparen'>)</span>
|
499
|
+
<span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_handler'>handler</span><span class='comma'>,</span> <span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
|
500
|
+
<span class='kw'>end</span></pre>
|
501
|
+
</td>
|
502
|
+
</tr>
|
503
|
+
</table>
|
504
|
+
</div>
|
505
|
+
|
506
|
+
<div class="method_details ">
|
507
|
+
<h3 class="signature " id="error_handle_fordidden-instance_method">
|
508
|
+
|
509
|
+
- (<tt>Object</tt>) <strong>error_handle_fordidden</strong>(exception)
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
</h3><table class="source_code">
|
516
|
+
<tr>
|
517
|
+
<td>
|
518
|
+
<pre class="lines">
|
519
|
+
|
520
|
+
|
521
|
+
47
|
522
|
+
48
|
523
|
+
49
|
524
|
+
50</pre>
|
525
|
+
</td>
|
526
|
+
<td>
|
527
|
+
<pre class="code"><span class="info file"># File 'lib/apes/concerns/errors.rb', line 47</span>
|
528
|
+
|
529
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_handle_fordidden'>error_handle_fordidden</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
|
530
|
+
<span class='ivar'>@authentication_error</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='label'>error:</span> <span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>?</span> <span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>You don't have access to this resource.</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span>
|
531
|
+
<span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>errors/403</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>status:</span> <span class='symbol'>:forbidden</span><span class='rparen'>)</span>
|
532
|
+
<span class='kw'>end</span></pre>
|
533
|
+
</td>
|
534
|
+
</tr>
|
535
|
+
</table>
|
536
|
+
</div>
|
537
|
+
|
538
|
+
<div class="method_details ">
|
539
|
+
<h3 class="signature " id="error_handle_general-instance_method">
|
540
|
+
|
541
|
+
- (<tt>Object</tt>) <strong>error_handle_general</strong>(exception)
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
|
546
|
+
|
547
|
+
</h3><table class="source_code">
|
548
|
+
<tr>
|
549
|
+
<td>
|
550
|
+
<pre class="lines">
|
551
|
+
|
552
|
+
|
553
|
+
32
|
554
|
+
33
|
555
|
+
34</pre>
|
556
|
+
</td>
|
557
|
+
<td>
|
558
|
+
<pre class="code"><span class="info file"># File 'lib/apes/concerns/errors.rb', line 32</span>
|
559
|
+
|
560
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_handle_general'>error_handle_general</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
|
561
|
+
<span class='id identifier rubyid_render_error'>render_error</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_details'>details</span><span class='lbracket'>[</span><span class='symbol'>:status</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_details'>details</span><span class='lbracket'>[</span><span class='symbol'>:error</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
562
|
+
<span class='kw'>end</span></pre>
|
563
|
+
</td>
|
564
|
+
</tr>
|
565
|
+
</table>
|
566
|
+
</div>
|
567
|
+
|
568
|
+
<div class="method_details ">
|
569
|
+
<h3 class="signature " id="error_handle_invalid_data-instance_method">
|
570
|
+
|
571
|
+
- (<tt>Object</tt>) <strong>error_handle_invalid_data</strong>(_ = nil)
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
</h3><table class="source_code">
|
578
|
+
<tr>
|
579
|
+
<td>
|
580
|
+
<pre class="lines">
|
581
|
+
|
582
|
+
|
583
|
+
66
|
584
|
+
67
|
585
|
+
68
|
586
|
+
69</pre>
|
587
|
+
</td>
|
588
|
+
<td>
|
589
|
+
<pre class="code"><span class="info file"># File 'lib/apes/concerns/errors.rb', line 66</span>
|
590
|
+
|
591
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_handle_invalid_data'>error_handle_invalid_data</span><span class='lparen'>(</span><span class='id identifier rubyid__'>_</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
592
|
+
<span class='ivar'>@reason</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Invalid data provided.</span><span class='tstring_end'>"</span></span>
|
593
|
+
<span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>errors/400</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>status:</span> <span class='symbol'>:bad_request</span><span class='rparen'>)</span>
|
594
|
+
<span class='kw'>end</span></pre>
|
595
|
+
</td>
|
596
|
+
</tr>
|
597
|
+
</table>
|
598
|
+
</div>
|
599
|
+
|
600
|
+
<div class="method_details ">
|
601
|
+
<h3 class="signature " id="error_handle_missing_data-instance_method">
|
602
|
+
|
603
|
+
- (<tt>Object</tt>) <strong>error_handle_missing_data</strong>(_ = nil)
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
|
609
|
+
</h3><table class="source_code">
|
610
|
+
<tr>
|
611
|
+
<td>
|
612
|
+
<pre class="lines">
|
613
|
+
|
614
|
+
|
615
|
+
61
|
616
|
+
62
|
617
|
+
63
|
618
|
+
64</pre>
|
619
|
+
</td>
|
620
|
+
<td>
|
621
|
+
<pre class="code"><span class="info file"># File 'lib/apes/concerns/errors.rb', line 61</span>
|
622
|
+
|
623
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_handle_missing_data'>error_handle_missing_data</span><span class='lparen'>(</span><span class='id identifier rubyid__'>_</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
624
|
+
<span class='ivar'>@reason</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Missing data.</span><span class='tstring_end'>"</span></span>
|
625
|
+
<span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>errors/400</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>status:</span> <span class='symbol'>:bad_request</span><span class='rparen'>)</span>
|
626
|
+
<span class='kw'>end</span></pre>
|
627
|
+
</td>
|
628
|
+
</tr>
|
629
|
+
</table>
|
630
|
+
</div>
|
631
|
+
|
632
|
+
<div class="method_details ">
|
633
|
+
<h3 class="signature " id="error_handle_not_found-instance_method">
|
634
|
+
|
635
|
+
- (<tt>Object</tt>) <strong>error_handle_not_found</strong>(_ = nil)
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
</h3><table class="source_code">
|
642
|
+
<tr>
|
643
|
+
<td>
|
644
|
+
<pre class="lines">
|
645
|
+
|
646
|
+
|
647
|
+
52
|
648
|
+
53
|
649
|
+
54</pre>
|
650
|
+
</td>
|
651
|
+
<td>
|
652
|
+
<pre class="code"><span class="info file"># File 'lib/apes/concerns/errors.rb', line 52</span>
|
653
|
+
|
654
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_handle_not_found'>error_handle_not_found</span><span class='lparen'>(</span><span class='id identifier rubyid__'>_</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
655
|
+
<span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>errors/404</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>status:</span> <span class='symbol'>:not_found</span><span class='rparen'>)</span>
|
656
|
+
<span class='kw'>end</span></pre>
|
657
|
+
</td>
|
658
|
+
</tr>
|
659
|
+
</table>
|
660
|
+
</div>
|
661
|
+
|
662
|
+
<div class="method_details ">
|
663
|
+
<h3 class="signature " id="error_handle_others-instance_method">
|
664
|
+
|
665
|
+
- (<tt>Object</tt>) <strong>error_handle_others</strong>(exception)
|
666
|
+
|
667
|
+
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
</h3><table class="source_code">
|
672
|
+
<tr>
|
673
|
+
<td>
|
674
|
+
<pre class="lines">
|
675
|
+
|
676
|
+
|
677
|
+
36
|
678
|
+
37
|
679
|
+
38
|
680
|
+
39
|
681
|
+
40
|
682
|
+
41</pre>
|
683
|
+
</td>
|
684
|
+
<td>
|
685
|
+
<pre class="code"><span class="info file"># File 'lib/apes/concerns/errors.rb', line 36</span>
|
686
|
+
|
687
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_handle_others'>error_handle_others</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
|
688
|
+
<span class='ivar'>@exception</span> <span class='op'>=</span> <span class='id identifier rubyid_exception'>exception</span>
|
689
|
+
<span class='ivar'>@backtrace</span> <span class='op'>=</span> <span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span>
|
690
|
+
<span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='int'>0</span><span class='comma'>,</span> <span class='int'>50</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_rails_root'>rails_root</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>$RAILS</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_gems_root'>gems_root</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>$GEMS</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
691
|
+
<span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>errors/500</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>status:</span> <span class='symbol'>:internal_server_error</span><span class='rparen'>)</span>
|
692
|
+
<span class='kw'>end</span></pre>
|
693
|
+
</td>
|
694
|
+
</tr>
|
695
|
+
</table>
|
696
|
+
</div>
|
697
|
+
|
698
|
+
<div class="method_details ">
|
699
|
+
<h3 class="signature " id="error_handle_unknown_attribute-instance_method">
|
700
|
+
|
701
|
+
- (<tt>Object</tt>) <strong>error_handle_unknown_attribute</strong>(exception)
|
702
|
+
|
703
|
+
|
704
|
+
|
705
|
+
|
706
|
+
|
707
|
+
</h3><table class="source_code">
|
708
|
+
<tr>
|
709
|
+
<td>
|
710
|
+
<pre class="lines">
|
711
|
+
|
712
|
+
|
713
|
+
71
|
714
|
+
72
|
715
|
+
73
|
716
|
+
74</pre>
|
717
|
+
</td>
|
718
|
+
<td>
|
719
|
+
<pre class="code"><span class="info file"># File 'lib/apes/concerns/errors.rb', line 71</span>
|
720
|
+
|
721
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_handle_unknown_attribute'>error_handle_unknown_attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
|
722
|
+
<span class='ivar'>@errors</span> <span class='op'>=</span> <span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>ActionController</span><span class='op'>::</span><span class='const'>UnpermittedParameters</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_params'>params</span> <span class='op'>:</span> <span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_attribute'>attribute</span>
|
723
|
+
<span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>errors/422</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>status:</span> <span class='symbol'>:unprocessable_entity</span><span class='rparen'>)</span>
|
724
|
+
<span class='kw'>end</span></pre>
|
725
|
+
</td>
|
726
|
+
</tr>
|
727
|
+
</table>
|
728
|
+
</div>
|
729
|
+
|
730
|
+
<div class="method_details ">
|
731
|
+
<h3 class="signature " id="error_handle_validation-instance_method">
|
732
|
+
|
733
|
+
- (<tt>Object</tt>) <strong>error_handle_validation</strong>(exception)
|
734
|
+
|
735
|
+
|
736
|
+
|
737
|
+
|
738
|
+
|
739
|
+
</h3><table class="source_code">
|
740
|
+
<tr>
|
741
|
+
<td>
|
742
|
+
<pre class="lines">
|
743
|
+
|
744
|
+
|
745
|
+
76
|
746
|
+
77
|
747
|
+
78
|
748
|
+
79</pre>
|
749
|
+
</td>
|
750
|
+
<td>
|
751
|
+
<pre class="code"><span class="info file"># File 'lib/apes/concerns/errors.rb', line 76</span>
|
752
|
+
|
753
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_handle_validation'>error_handle_validation</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
|
754
|
+
<span class='ivar'>@errors</span> <span class='op'>=</span> <span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_record'>record</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_to_hash'>to_hash</span>
|
755
|
+
<span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>errors/422</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>status:</span> <span class='symbol'>:unprocessable_entity</span><span class='rparen'>)</span>
|
756
|
+
<span class='kw'>end</span></pre>
|
757
|
+
</td>
|
758
|
+
</tr>
|
759
|
+
</table>
|
760
|
+
</div>
|
761
|
+
|
762
|
+
<div class="method_details ">
|
763
|
+
<h3 class="signature " id="fail_request!-instance_method">
|
764
|
+
|
765
|
+
- (<tt>Object</tt>) <strong>fail_request!</strong>(status, error)
|
766
|
+
|
767
|
+
|
768
|
+
|
769
|
+
|
770
|
+
|
771
|
+
</h3><div class="docstring">
|
772
|
+
<div class="discussion">
|
773
|
+
|
774
|
+
|
775
|
+
|
776
|
+
</div>
|
777
|
+
</div>
|
778
|
+
<div class="tags">
|
779
|
+
|
780
|
+
<p class="tag_title">Raises:</p>
|
781
|
+
<ul class="raise">
|
782
|
+
|
783
|
+
<li>
|
784
|
+
|
785
|
+
|
786
|
+
<span class='type'>(<tt>Errors::BaseError</tt>)</span>
|
787
|
+
|
788
|
+
|
789
|
+
|
790
|
+
</li>
|
791
|
+
|
792
|
+
</ul>
|
793
|
+
|
794
|
+
</div><table class="source_code">
|
795
|
+
<tr>
|
796
|
+
<td>
|
797
|
+
<pre class="lines">
|
798
|
+
|
799
|
+
|
800
|
+
23
|
801
|
+
24
|
802
|
+
25</pre>
|
803
|
+
</td>
|
804
|
+
<td>
|
805
|
+
<pre class="code"><span class="info file"># File 'lib/apes/concerns/errors.rb', line 23</span>
|
806
|
+
|
807
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_fail_request!'>fail_request!</span><span class='lparen'>(</span><span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='id identifier rubyid_error'>error</span><span class='rparen'>)</span>
|
808
|
+
<span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>BaseError</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>status:</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_error'>error</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
809
|
+
<span class='kw'>end</span></pre>
|
810
|
+
</td>
|
811
|
+
</tr>
|
812
|
+
</table>
|
813
|
+
</div>
|
814
|
+
|
815
|
+
</div>
|
816
|
+
|
817
|
+
</div>
|
818
|
+
|
819
|
+
<div id="footer">
|
820
|
+
Generated on Sat May 21 11:01:51 2016 by
|
821
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
822
|
+
0.8.7.6 (ruby-2.3.0).
|
823
|
+
</div>
|
824
|
+
|
825
|
+
</body>
|
826
|
+
</html>
|