ballast 2.1.3 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/doc/Ballast.html +1 -1
- data/doc/Ballast/AjaxResponse.html +1 -1
- data/doc/Ballast/Concerns.html +1 -1
- data/doc/Ballast/Concerns/AjaxHandling.html +1 -1
- data/doc/Ballast/Concerns/Common.html +1 -1
- data/doc/Ballast/Concerns/ErrorsHandling.html +1 -1
- data/doc/Ballast/Concerns/View.html +1 -1
- data/doc/Ballast/Configuration.html +1 -1
- data/doc/Ballast/Emoji.html +1 -1
- data/doc/Ballast/Emoji/Character.html +1 -1
- data/doc/Ballast/Emoji/Utils.html +1 -1
- data/doc/Ballast/Errors.html +1 -1
- data/doc/Ballast/Errors/Base.html +1 -1
- data/doc/Ballast/Errors/Failure.html +1 -1
- data/doc/Ballast/Errors/InvalidDomain.html +1 -1
- data/doc/Ballast/Errors/ValidationFailure.html +1 -1
- data/doc/Ballast/Middlewares.html +1 -1
- data/doc/Ballast/Middlewares/DefaultHost.html +1 -1
- data/doc/Ballast/RequestDomainMatcher.html +1 -1
- data/doc/Ballast/Service.html +255 -43
- data/doc/Ballast/Service/Response.html +1 -1
- data/doc/Ballast/Version.html +3 -3
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +33 -21
- data/doc/top-level-namespace.html +1 -1
- data/lib/ballast/service.rb +17 -5
- data/lib/ballast/version.rb +2 -2
- data/spec/ballast/service_spec.rb +10 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 831bec995600c12211acef57807be3ef3418d464
|
4
|
+
data.tar.gz: 9faabdb0f6bba36a70e586fddeb0c1e508c9f971
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acdfb157d6f82f80c3dc844b82a1d71355cb6a185ecf22dd41fd477291ffe2187eb273fa2797a3da7b0cac307fca9e7af6df0c9a5418d64d44401f6d102938ee
|
7
|
+
data.tar.gz: 4875408b81e99f33f31281478a1734b3b34930ab550dc9cb4ab765b629c3753a60f06917dd16a0c11b0f19e15caf321bdfcf08066f7745e3dbf16c8f2d43446f
|
data/CHANGELOG.md
CHANGED
data/doc/Ballast.html
CHANGED
@@ -256,7 +256,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
256
256
|
</div>
|
257
257
|
|
258
258
|
<div id="footer">
|
259
|
-
Generated on Fri Feb 6
|
259
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
260
260
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
261
261
|
0.8.7.6 (ruby-2.2.0).
|
262
262
|
</div>
|
@@ -1459,7 +1459,7 @@
|
|
1459
1459
|
</div>
|
1460
1460
|
|
1461
1461
|
<div id="footer">
|
1462
|
-
Generated on Fri Feb 6
|
1462
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
1463
1463
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1464
1464
|
0.8.7.6 (ruby-2.2.0).
|
1465
1465
|
</div>
|
data/doc/Ballast/Concerns.html
CHANGED
@@ -118,7 +118,7 @@
|
|
118
118
|
</div>
|
119
119
|
|
120
120
|
<div id="footer">
|
121
|
-
Generated on Fri Feb 6
|
121
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
122
122
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
123
123
|
0.8.7.6 (ruby-2.2.0).
|
124
124
|
</div>
|
@@ -658,7 +658,7 @@
|
|
658
658
|
</div>
|
659
659
|
|
660
660
|
<div id="footer">
|
661
|
-
Generated on Fri Feb 6
|
661
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
662
662
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
663
663
|
0.8.7.6 (ruby-2.2.0).
|
664
664
|
</div>
|
@@ -956,7 +956,7 @@ and <code>%:Z</code> for the zone name considering also DST.</p>
|
|
956
956
|
</div>
|
957
957
|
|
958
958
|
<div id="footer">
|
959
|
-
Generated on Fri Feb 6
|
959
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
960
960
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
961
961
|
0.8.7.6 (ruby-2.2.0).
|
962
962
|
</div>
|
@@ -274,7 +274,7 @@
|
|
274
274
|
</div>
|
275
275
|
|
276
276
|
<div id="footer">
|
277
|
-
Generated on Fri Feb 6
|
277
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
278
278
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
279
279
|
0.8.7.6 (ruby-2.2.0).
|
280
280
|
</div>
|
@@ -881,7 +881,7 @@
|
|
881
881
|
</div>
|
882
882
|
|
883
883
|
<div id="footer">
|
884
|
-
Generated on Fri Feb 6
|
884
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
885
885
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
886
886
|
0.8.7.6 (ruby-2.2.0).
|
887
887
|
</div>
|
@@ -451,7 +451,7 @@ Subfolders are not supported.</p>
|
|
451
451
|
</div>
|
452
452
|
|
453
453
|
<div id="footer">
|
454
|
-
Generated on Fri Feb 6
|
454
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
455
455
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
456
456
|
0.8.7.6 (ruby-2.2.0).
|
457
457
|
</div>
|
data/doc/Ballast/Emoji.html
CHANGED
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on Fri Feb 6
|
119
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.8.7.6 (ruby-2.2.0).
|
122
122
|
</div>
|
@@ -405,7 +405,7 @@
|
|
405
405
|
</div>
|
406
406
|
|
407
407
|
<div id="footer">
|
408
|
-
Generated on Fri Feb 6
|
408
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
409
409
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
410
410
|
0.8.7.6 (ruby-2.2.0).
|
411
411
|
</div>
|
@@ -790,7 +790,7 @@
|
|
790
790
|
</div>
|
791
791
|
|
792
792
|
<div id="footer">
|
793
|
-
Generated on Fri Feb 6
|
793
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
794
794
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
795
795
|
0.8.7.6 (ruby-2.2.0).
|
796
796
|
</div>
|
data/doc/Ballast/Errors.html
CHANGED
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on Fri Feb 6
|
119
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.8.7.6 (ruby-2.2.0).
|
122
122
|
</div>
|
@@ -346,7 +346,7 @@
|
|
346
346
|
</div>
|
347
347
|
|
348
348
|
<div id="footer">
|
349
|
-
Generated on Fri Feb 6
|
349
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
350
350
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
351
351
|
0.8.7.6 (ruby-2.2.0).
|
352
352
|
</div>
|
@@ -152,7 +152,7 @@
|
|
152
152
|
</div>
|
153
153
|
|
154
154
|
<div id="footer">
|
155
|
-
Generated on Fri Feb 6
|
155
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
156
156
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
157
157
|
0.8.7.6 (ruby-2.2.0).
|
158
158
|
</div>
|
@@ -148,7 +148,7 @@
|
|
148
148
|
</div>
|
149
149
|
|
150
150
|
<div id="footer">
|
151
|
-
Generated on Fri Feb 6
|
151
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
152
152
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
153
153
|
0.8.7.6 (ruby-2.2.0).
|
154
154
|
</div>
|
@@ -156,7 +156,7 @@
|
|
156
156
|
</div>
|
157
157
|
|
158
158
|
<div id="footer">
|
159
|
-
Generated on Fri Feb 6
|
159
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
160
160
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
161
161
|
0.8.7.6 (ruby-2.2.0).
|
162
162
|
</div>
|
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on Fri Feb 6
|
119
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.8.7.6 (ruby-2.2.0).
|
122
122
|
</div>
|
@@ -347,7 +347,7 @@
|
|
347
347
|
</div>
|
348
348
|
|
349
349
|
<div id="footer">
|
350
|
-
Generated on Fri Feb 6
|
350
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
351
351
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
352
352
|
0.8.7.6 (ruby-2.2.0).
|
353
353
|
</div>
|
@@ -914,7 +914,7 @@
|
|
914
914
|
</div>
|
915
915
|
|
916
916
|
<div id="footer">
|
917
|
-
Generated on Fri Feb 6
|
917
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
918
918
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
919
919
|
0.8.7.6 (ruby-2.2.0).
|
920
920
|
</div>
|
data/doc/Ballast/Service.html
CHANGED
@@ -210,6 +210,29 @@
|
|
210
210
|
<span class="summary_desc"><div class='inline'><p>Marks the failure of the operation.</p>
|
211
211
|
</div></span>
|
212
212
|
|
213
|
+
</li>
|
214
|
+
|
215
|
+
|
216
|
+
<li class="public ">
|
217
|
+
<span class="summary_signature">
|
218
|
+
|
219
|
+
<a href="#fail_validation%21-class_method" title="fail_validation! (class method)">+ (Object) <strong>fail_validation!</strong>(details) </a>
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
</span>
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
<span class="summary_desc"><div class='inline'><p>Marks the failure of the validation of the operation.</p>
|
234
|
+
</div></span>
|
235
|
+
|
213
236
|
</li>
|
214
237
|
|
215
238
|
|
@@ -271,7 +294,7 @@
|
|
271
294
|
<li class="public ">
|
272
295
|
<span class="summary_signature">
|
273
296
|
|
274
|
-
<a href="#fail%21-instance_method" title="#fail! (instance method)">- (Object) <strong>fail!</strong>(details
|
297
|
+
<a href="#fail%21-instance_method" title="#fail! (instance method)">- (Object) <strong>fail!</strong>(details) </a>
|
275
298
|
|
276
299
|
|
277
300
|
|
@@ -288,6 +311,29 @@
|
|
288
311
|
<span class="summary_desc"><div class='inline'><p>Marks the failure of the operation.</p>
|
289
312
|
</div></span>
|
290
313
|
|
314
|
+
</li>
|
315
|
+
|
316
|
+
|
317
|
+
<li class="public ">
|
318
|
+
<span class="summary_signature">
|
319
|
+
|
320
|
+
<a href="#fail_validation%21-instance_method" title="#fail_validation! (instance method)">- (Object) <strong>fail_validation!</strong>(details) </a>
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
</span>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
<span class="summary_desc"><div class='inline'><p>Marks the failure of the validation of the operation.</p>
|
335
|
+
</div></span>
|
336
|
+
|
291
337
|
</li>
|
292
338
|
|
293
339
|
|
@@ -368,12 +414,12 @@
|
|
368
414
|
<pre class="lines">
|
369
415
|
|
370
416
|
|
371
|
-
|
372
|
-
|
373
|
-
|
417
|
+
115
|
418
|
+
116
|
419
|
+
117</pre>
|
374
420
|
</td>
|
375
421
|
<td>
|
376
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line
|
422
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 115</span>
|
377
423
|
|
378
424
|
<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_owner identifier id'>owner</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span>
|
379
425
|
<span class='rubyid_@owner ivar id'>@owner</span> <span class='assign token'>=</span> <span class='rubyid_owner identifier id'>owner</span>
|
@@ -569,7 +615,19 @@
|
|
569
615
|
144
|
570
616
|
145
|
571
617
|
146
|
572
|
-
147
|
618
|
+
147
|
619
|
+
148
|
620
|
+
149
|
621
|
+
150
|
622
|
+
151
|
623
|
+
152
|
624
|
+
153
|
625
|
+
154
|
626
|
+
155
|
627
|
+
156
|
628
|
+
157
|
629
|
+
158
|
630
|
+
159</pre>
|
573
631
|
</td>
|
574
632
|
<td>
|
575
633
|
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 11</span>
|
@@ -664,9 +722,15 @@
|
|
664
722
|
<span class='comment val'># Marks the failure of the operation.</span>
|
665
723
|
<span class='comment val'>#</span>
|
666
724
|
<span class='comment val'># @param details [Object] The error(s) occurred.</span>
|
667
|
-
<span class='comment val'># @param on_validation [Boolean] Whether the error(s) was/were validation error(s).</span>
|
668
725
|
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_fail! fid id'>fail!</span><span class='lparen token'>(</span><span class='rubyid_details identifier id'>details</span><span class='comma token'>,</span> <span class='label val'>on_validation:</span> <span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span>
|
669
|
-
<span class='rubyid_raise identifier id'>raise</span><span class='lparen token'>(</span><span class='
|
726
|
+
<span class='rubyid_raise identifier id'>raise</span><span class='lparen token'>(</span><span class='rubyid_Errors constant id'>Errors</span><span class='colon2 op'>::</span><span class='rubyid_Failure constant id'>Failure</span><span class='comma token'>,</span> <span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
727
|
+
<span class='rubyid_end end kw'>end</span>
|
728
|
+
|
729
|
+
<span class='comment val'># Marks the failure of the validation of the operation.</span>
|
730
|
+
<span class='comment val'>#</span>
|
731
|
+
<span class='comment val'># @param details [Object] The error(s) occurred.</span>
|
732
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_fail_validation! fid id'>fail_validation!</span><span class='lparen token'>(</span><span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
733
|
+
<span class='rubyid_raise identifier id'>raise</span><span class='lparen token'>(</span><span class='rubyid_Errors constant id'>Errors</span><span class='colon2 op'>::</span><span class='rubyid_ValidationFailure constant id'>ValidationFailure</span><span class='comma token'>,</span> <span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
670
734
|
<span class='rubyid_end end kw'>end</span>
|
671
735
|
|
672
736
|
<span class='comment val'># Creates a service object.</span>
|
@@ -697,9 +761,15 @@
|
|
697
761
|
<span class='comment val'># Marks the failure of the operation.</span>
|
698
762
|
<span class='comment val'>#</span>
|
699
763
|
<span class='comment val'># @param details [Object] The error(s) occurred.</span>
|
700
|
-
<span class='
|
701
|
-
|
702
|
-
|
764
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_fail! fid id'>fail!</span><span class='lparen token'>(</span><span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
765
|
+
<span class='rubyid_raise identifier id'>raise</span><span class='lparen token'>(</span><span class='rubyid_Errors constant id'>Errors</span><span class='colon2 op'>::</span><span class='rubyid_Failure constant id'>Failure</span><span class='comma token'>,</span> <span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
766
|
+
<span class='rubyid_end end kw'>end</span>
|
767
|
+
|
768
|
+
<span class='comment val'># Marks the failure of the validation of the operation.</span>
|
769
|
+
<span class='comment val'>#</span>
|
770
|
+
<span class='comment val'># @param details [Object] The error(s) occurred.</span>
|
771
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_fail_validation! fid id'>fail_validation!</span><span class='lparen token'>(</span><span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
772
|
+
<span class='rubyid_raise identifier id'>raise</span><span class='lparen token'>(</span><span class='rubyid_Errors constant id'>Errors</span><span class='colon2 op'>::</span><span class='rubyid_ValidationFailure constant id'>ValidationFailure</span><span class='comma token'>,</span> <span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
703
773
|
<span class='rubyid_end end kw'>end</span>
|
704
774
|
|
705
775
|
<span class='comment val'># Handles a failure.</span>
|
@@ -919,23 +989,94 @@
|
|
919
989
|
|
920
990
|
</li>
|
921
991
|
|
992
|
+
</ul>
|
993
|
+
|
994
|
+
<p class="tag_title">Raises:</p>
|
995
|
+
<ul class="raise">
|
996
|
+
|
922
997
|
<li>
|
923
998
|
|
924
|
-
<span class='name'>on_validation</span>
|
925
999
|
|
1000
|
+
<span class='type'>(<tt><span class='object_link'><a href="Errors/Failure.html" title="Ballast::Errors::Failure (class)">Errors::Failure</a></span></tt>)</span>
|
926
1001
|
|
927
|
-
|
1002
|
+
|
1003
|
+
|
1004
|
+
</li>
|
1005
|
+
|
1006
|
+
</ul>
|
1007
|
+
|
1008
|
+
</div><table class="source_code">
|
1009
|
+
<tr>
|
1010
|
+
<td>
|
1011
|
+
<pre class="lines">
|
1012
|
+
|
1013
|
+
|
1014
|
+
101
|
1015
|
+
102
|
1016
|
+
103</pre>
|
1017
|
+
</td>
|
1018
|
+
<td>
|
1019
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 101</span>
|
1020
|
+
|
1021
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_fail! fid id'>fail!</span><span class='lparen token'>(</span><span class='rubyid_details identifier id'>details</span><span class='comma token'>,</span> <span class='label val'>on_validation:</span> <span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span>
|
1022
|
+
<span class='rubyid_raise identifier id'>raise</span><span class='lparen token'>(</span><span class='rubyid_Errors constant id'>Errors</span><span class='colon2 op'>::</span><span class='rubyid_Failure constant id'>Failure</span><span class='comma token'>,</span> <span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
1023
|
+
<span class='rubyid_end end kw'>end</span>
|
1024
|
+
</pre>
|
1025
|
+
</td>
|
1026
|
+
</tr>
|
1027
|
+
</table>
|
1028
|
+
</div>
|
1029
|
+
|
1030
|
+
<div class="method_details ">
|
1031
|
+
<h3 class="signature " id="fail_validation!-class_method">
|
1032
|
+
|
1033
|
+
+ (<tt>Object</tt>) <strong>fail_validation!</strong>(details)
|
1034
|
+
|
1035
|
+
|
1036
|
+
|
1037
|
+
|
1038
|
+
|
1039
|
+
</h3><div class="docstring">
|
1040
|
+
<div class="discussion">
|
1041
|
+
<p>Marks the failure of the validation of the operation.</p>
|
1042
|
+
|
1043
|
+
|
1044
|
+
</div>
|
1045
|
+
</div>
|
1046
|
+
<div class="tags">
|
1047
|
+
<p class="tag_title">Parameters:</p>
|
1048
|
+
<ul class="param">
|
1049
|
+
|
1050
|
+
<li>
|
1051
|
+
|
1052
|
+
<span class='name'>details</span>
|
1053
|
+
|
1054
|
+
|
1055
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
928
1056
|
|
929
1057
|
|
930
1058
|
|
931
1059
|
—
|
932
|
-
<div class='inline'><p>
|
1060
|
+
<div class='inline'><p>The error(s) occurred.</p>
|
933
1061
|
</div>
|
934
1062
|
|
935
1063
|
</li>
|
936
1064
|
|
937
1065
|
</ul>
|
938
1066
|
|
1067
|
+
<p class="tag_title">Raises:</p>
|
1068
|
+
<ul class="raise">
|
1069
|
+
|
1070
|
+
<li>
|
1071
|
+
|
1072
|
+
|
1073
|
+
<span class='type'>(<tt><span class='object_link'><a href="Errors/ValidationFailure.html" title="Ballast::Errors::ValidationFailure (class)">Errors::ValidationFailure</a></span></tt>)</span>
|
1074
|
+
|
1075
|
+
|
1076
|
+
|
1077
|
+
</li>
|
1078
|
+
|
1079
|
+
</ul>
|
939
1080
|
|
940
1081
|
</div><table class="source_code">
|
941
1082
|
<tr>
|
@@ -943,15 +1084,15 @@
|
|
943
1084
|
<pre class="lines">
|
944
1085
|
|
945
1086
|
|
946
|
-
|
947
|
-
|
948
|
-
|
1087
|
+
108
|
1088
|
+
109
|
1089
|
+
110</pre>
|
949
1090
|
</td>
|
950
1091
|
<td>
|
951
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line
|
1092
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 108</span>
|
952
1093
|
|
953
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='
|
954
|
-
<span class='rubyid_raise identifier id'>raise</span><span class='lparen token'>(</span><span class='
|
1094
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_fail_validation! fid id'>fail_validation!</span><span class='lparen token'>(</span><span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
1095
|
+
<span class='rubyid_raise identifier id'>raise</span><span class='lparen token'>(</span><span class='rubyid_Errors constant id'>Errors</span><span class='colon2 op'>::</span><span class='rubyid_ValidationFailure constant id'>ValidationFailure</span><span class='comma token'>,</span> <span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
955
1096
|
<span class='rubyid_end end kw'>end</span>
|
956
1097
|
</pre>
|
957
1098
|
</td>
|
@@ -1035,12 +1176,12 @@
|
|
1035
1176
|
<pre class="lines">
|
1036
1177
|
|
1037
1178
|
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1179
|
+
156
|
1180
|
+
157
|
1181
|
+
158</pre>
|
1041
1182
|
</td>
|
1042
1183
|
<td>
|
1043
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line
|
1184
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 156</span>
|
1044
1185
|
|
1045
1186
|
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_handle_failure identifier id'>handle_failure</span><span class='lparen token'>(</span><span class='rubyid_failure identifier id'>failure</span><span class='comma token'>,</span> <span class='rubyid_raise_errors identifier id'>raise_errors</span><span class='rparen token'>)</span>
|
1046
1187
|
<span class='rubyid_raise_errors identifier id'>raise_errors</span> <span class='integer val'>? </span><span class='rubyid_raise identifier id'>raise</span><span class='lparen token'>(</span><span class='rubyid_failure identifier id'>failure</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_Response constant id'>Response</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_false false kw'>false</span><span class='comma token'>,</span> <span class='label val'>error:</span> <span class='rubyid_failure identifier id'>failure</span><span class='dot token'>.</span><span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
@@ -1195,17 +1336,17 @@
|
|
1195
1336
|
<pre class="lines">
|
1196
1337
|
|
1197
1338
|
|
1198
|
-
122
|
1199
|
-
123
|
1200
|
-
124
|
1201
|
-
125
|
1202
|
-
126
|
1203
|
-
127
|
1204
1339
|
128
|
1205
|
-
129
|
1340
|
+
129
|
1341
|
+
130
|
1342
|
+
131
|
1343
|
+
132
|
1344
|
+
133
|
1345
|
+
134
|
1346
|
+
135</pre>
|
1206
1347
|
</td>
|
1207
1348
|
<td>
|
1208
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line
|
1349
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 128</span>
|
1209
1350
|
|
1210
1351
|
<span class='rubyid_def def kw'>def</span> <span class='rubyid_call identifier id'>call</span><span class='lparen token'>(</span><span class='rubyid_operation identifier id'>operation</span> <span class='assign token'>=</span> <span class='symbol val'>:perform</span><span class='comma token'>,</span> <span class='label val'>owner:</span> <span class='rubyid_nil nil kw'>nil</span><span class='comma token'>,</span> <span class='label val'>raise_errors:</span> <span class='rubyid_false false kw'>false</span><span class='comma token'>,</span> <span class='label val'>params:</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='comma token'>,</span> <span class='pow op'>**</span><span class='rubyid_kwargs identifier id'>kwargs</span><span class='comma token'>,</span> <span class='bitand op'>&</span><span class='rubyid_block identifier id'>block</span><span class='rparen token'>)</span>
|
1211
1352
|
<span class='comment val'># PI: Ignore Roodi on this method</span>
|
@@ -1224,7 +1365,7 @@
|
|
1224
1365
|
<div class="method_details ">
|
1225
1366
|
<h3 class="signature " id="fail!-instance_method">
|
1226
1367
|
|
1227
|
-
- (<tt>Object</tt>) <strong>fail!</strong>(details
|
1368
|
+
- (<tt>Object</tt>) <strong>fail!</strong>(details)
|
1228
1369
|
|
1229
1370
|
|
1230
1371
|
|
@@ -1256,23 +1397,94 @@
|
|
1256
1397
|
|
1257
1398
|
</li>
|
1258
1399
|
|
1400
|
+
</ul>
|
1401
|
+
|
1402
|
+
<p class="tag_title">Raises:</p>
|
1403
|
+
<ul class="raise">
|
1404
|
+
|
1259
1405
|
<li>
|
1260
1406
|
|
1261
|
-
<span class='name'>on_validation</span>
|
1262
1407
|
|
1408
|
+
<span class='type'>(<tt><span class='object_link'><a href="Errors/Failure.html" title="Ballast::Errors::Failure (class)">Errors::Failure</a></span></tt>)</span>
|
1263
1409
|
|
1264
|
-
|
1410
|
+
|
1411
|
+
|
1412
|
+
</li>
|
1413
|
+
|
1414
|
+
</ul>
|
1415
|
+
|
1416
|
+
</div><table class="source_code">
|
1417
|
+
<tr>
|
1418
|
+
<td>
|
1419
|
+
<pre class="lines">
|
1420
|
+
|
1421
|
+
|
1422
|
+
140
|
1423
|
+
141
|
1424
|
+
142</pre>
|
1425
|
+
</td>
|
1426
|
+
<td>
|
1427
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 140</span>
|
1428
|
+
|
1429
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_fail! fid id'>fail!</span><span class='lparen token'>(</span><span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
1430
|
+
<span class='rubyid_raise identifier id'>raise</span><span class='lparen token'>(</span><span class='rubyid_Errors constant id'>Errors</span><span class='colon2 op'>::</span><span class='rubyid_Failure constant id'>Failure</span><span class='comma token'>,</span> <span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
1431
|
+
<span class='rubyid_end end kw'>end</span>
|
1432
|
+
</pre>
|
1433
|
+
</td>
|
1434
|
+
</tr>
|
1435
|
+
</table>
|
1436
|
+
</div>
|
1437
|
+
|
1438
|
+
<div class="method_details ">
|
1439
|
+
<h3 class="signature " id="fail_validation!-instance_method">
|
1440
|
+
|
1441
|
+
- (<tt>Object</tt>) <strong>fail_validation!</strong>(details)
|
1442
|
+
|
1443
|
+
|
1444
|
+
|
1445
|
+
|
1446
|
+
|
1447
|
+
</h3><div class="docstring">
|
1448
|
+
<div class="discussion">
|
1449
|
+
<p>Marks the failure of the validation of the operation.</p>
|
1450
|
+
|
1451
|
+
|
1452
|
+
</div>
|
1453
|
+
</div>
|
1454
|
+
<div class="tags">
|
1455
|
+
<p class="tag_title">Parameters:</p>
|
1456
|
+
<ul class="param">
|
1457
|
+
|
1458
|
+
<li>
|
1459
|
+
|
1460
|
+
<span class='name'>details</span>
|
1461
|
+
|
1462
|
+
|
1463
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
1265
1464
|
|
1266
1465
|
|
1267
1466
|
|
1268
1467
|
—
|
1269
|
-
<div class='inline'><p>
|
1468
|
+
<div class='inline'><p>The error(s) occurred.</p>
|
1270
1469
|
</div>
|
1271
1470
|
|
1272
1471
|
</li>
|
1273
1472
|
|
1274
1473
|
</ul>
|
1275
1474
|
|
1475
|
+
<p class="tag_title">Raises:</p>
|
1476
|
+
<ul class="raise">
|
1477
|
+
|
1478
|
+
<li>
|
1479
|
+
|
1480
|
+
|
1481
|
+
<span class='type'>(<tt><span class='object_link'><a href="Errors/ValidationFailure.html" title="Ballast::Errors::ValidationFailure (class)">Errors::ValidationFailure</a></span></tt>)</span>
|
1482
|
+
|
1483
|
+
|
1484
|
+
|
1485
|
+
</li>
|
1486
|
+
|
1487
|
+
</ul>
|
1276
1488
|
|
1277
1489
|
</div><table class="source_code">
|
1278
1490
|
<tr>
|
@@ -1280,15 +1492,15 @@
|
|
1280
1492
|
<pre class="lines">
|
1281
1493
|
|
1282
1494
|
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1495
|
+
147
|
1496
|
+
148
|
1497
|
+
149</pre>
|
1286
1498
|
</td>
|
1287
1499
|
<td>
|
1288
|
-
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line
|
1500
|
+
<pre class="code"><span class="info file"># File 'lib/ballast/service.rb', line 147</span>
|
1289
1501
|
|
1290
|
-
<span class='rubyid_def def kw'>def</span> <span class='
|
1291
|
-
<span class='
|
1502
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_fail_validation! fid id'>fail_validation!</span><span class='lparen token'>(</span><span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
1503
|
+
<span class='rubyid_raise identifier id'>raise</span><span class='lparen token'>(</span><span class='rubyid_Errors constant id'>Errors</span><span class='colon2 op'>::</span><span class='rubyid_ValidationFailure constant id'>ValidationFailure</span><span class='comma token'>,</span> <span class='rubyid_details identifier id'>details</span><span class='rparen token'>)</span>
|
1292
1504
|
<span class='rubyid_end end kw'>end</span>
|
1293
1505
|
</pre>
|
1294
1506
|
</td>
|
@@ -1301,7 +1513,7 @@
|
|
1301
1513
|
</div>
|
1302
1514
|
|
1303
1515
|
<div id="footer">
|
1304
|
-
Generated on Fri Feb 6
|
1516
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
1305
1517
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1306
1518
|
0.8.7.6 (ruby-2.2.0).
|
1307
1519
|
</div>
|
@@ -1269,7 +1269,7 @@
|
|
1269
1269
|
</div>
|
1270
1270
|
|
1271
1271
|
<div id="footer">
|
1272
|
-
Generated on Fri Feb 6
|
1272
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
1273
1273
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1274
1274
|
0.8.7.6 (ruby-2.2.0).
|
1275
1275
|
</div>
|
data/doc/Ballast/Version.html
CHANGED
@@ -135,7 +135,7 @@
|
|
135
135
|
|
136
136
|
</div>
|
137
137
|
</dt>
|
138
|
-
<dd><pre class="code"><span class='integer val'>
|
138
|
+
<dd><pre class="code"><span class='integer val'>2</span>
|
139
139
|
</pre></dd>
|
140
140
|
|
141
141
|
<dt id="PATCH-constant" class="">PATCH =
|
@@ -151,7 +151,7 @@
|
|
151
151
|
|
152
152
|
</div>
|
153
153
|
</dt>
|
154
|
-
<dd><pre class="code"><span class='integer val'>
|
154
|
+
<dd><pre class="code"><span class='integer val'>0</span>
|
155
155
|
</pre></dd>
|
156
156
|
|
157
157
|
<dt id="STRING-constant" class="">STRING =
|
@@ -184,7 +184,7 @@
|
|
184
184
|
</div>
|
185
185
|
|
186
186
|
<div id="footer">
|
187
|
-
Generated on Fri Feb 6
|
187
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
188
188
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
189
189
|
0.8.7.6 (ruby-2.2.0).
|
190
190
|
</div>
|
data/doc/_index.html
CHANGED
@@ -339,7 +339,7 @@
|
|
339
339
|
</div>
|
340
340
|
|
341
341
|
<div id="footer">
|
342
|
-
Generated on Fri Feb 6
|
342
|
+
Generated on Fri Feb 6 16:18:33 2015 by
|
343
343
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
344
344
|
0.8.7.6 (ruby-2.2.0).
|
345
345
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -106,7 +106,7 @@
|
|
106
106
|
</div></div>
|
107
107
|
|
108
108
|
<div id="footer">
|
109
|
-
Generated on Fri Feb 6
|
109
|
+
Generated on Fri Feb 6 16:18:33 2015 by
|
110
110
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
111
111
|
0.8.7.6 (ruby-2.2.0).
|
112
112
|
</div>
|
data/doc/index.html
CHANGED
@@ -106,7 +106,7 @@
|
|
106
106
|
</div></div>
|
107
107
|
|
108
108
|
<div id="footer">
|
109
|
-
Generated on Fri Feb 6
|
109
|
+
Generated on Fri Feb 6 16:18:33 2015 by
|
110
110
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
111
111
|
0.8.7.6 (ruby-2.2.0).
|
112
112
|
</div>
|
data/doc/method_list.html
CHANGED
@@ -94,20 +94,20 @@
|
|
94
94
|
|
95
95
|
|
96
96
|
<li class="r2 ">
|
97
|
-
<span class='object_link'><a href="Ballast/
|
98
|
-
<small>Ballast::
|
97
|
+
<span class='object_link'><a href="Ballast/Service.html#call-class_method" title="Ballast::Service.call (method)">call</a></span>
|
98
|
+
<small>Ballast::Service</small>
|
99
99
|
</li>
|
100
100
|
|
101
101
|
|
102
102
|
<li class="r1 ">
|
103
|
-
<span class='object_link'><a href="Ballast/Service.html#call-
|
103
|
+
<span class='object_link'><a href="Ballast/Service.html#call-instance_method" title="Ballast::Service#call (method)">#call</a></span>
|
104
104
|
<small>Ballast::Service</small>
|
105
105
|
</li>
|
106
106
|
|
107
107
|
|
108
108
|
<li class="r2 ">
|
109
|
-
<span class='object_link'><a href="Ballast/
|
110
|
-
<small>Ballast::
|
109
|
+
<span class='object_link'><a href="Ballast/Middlewares/DefaultHost.html#call-instance_method" title="Ballast::Middlewares::DefaultHost#call (method)">#call</a></span>
|
110
|
+
<small>Ballast::Middlewares::DefaultHost</small>
|
111
111
|
</li>
|
112
112
|
|
113
113
|
|
@@ -154,14 +154,14 @@
|
|
154
154
|
|
155
155
|
|
156
156
|
<li class="r2 ">
|
157
|
-
<span class='object_link'><a href="Ballast/
|
158
|
-
<small>Ballast::
|
157
|
+
<span class='object_link'><a href="Ballast/Service/Response.html#error-instance_method" title="Ballast::Service::Response#error (method)">#error</a></span>
|
158
|
+
<small>Ballast::Service::Response</small>
|
159
159
|
</li>
|
160
160
|
|
161
161
|
|
162
162
|
<li class="r1 ">
|
163
|
-
<span class='object_link'><a href="Ballast/
|
164
|
-
<small>Ballast::
|
163
|
+
<span class='object_link'><a href="Ballast/AjaxResponse.html#error-instance_method" title="Ballast::AjaxResponse#error (method)">#error</a></span>
|
164
|
+
<small>Ballast::AjaxResponse</small>
|
165
165
|
</li>
|
166
166
|
|
167
167
|
|
@@ -189,6 +189,18 @@
|
|
189
189
|
</li>
|
190
190
|
|
191
191
|
|
192
|
+
<li class="r2 ">
|
193
|
+
<span class='object_link'><a href="Ballast/Service.html#fail_validation%21-class_method" title="Ballast::Service.fail_validation! (method)">fail_validation!</a></span>
|
194
|
+
<small>Ballast::Service</small>
|
195
|
+
</li>
|
196
|
+
|
197
|
+
|
198
|
+
<li class="r1 ">
|
199
|
+
<span class='object_link'><a href="Ballast/Service.html#fail_validation%21-instance_method" title="Ballast::Service#fail_validation! (method)">#fail_validation!</a></span>
|
200
|
+
<small>Ballast::Service</small>
|
201
|
+
</li>
|
202
|
+
|
203
|
+
|
192
204
|
<li class="r2 ">
|
193
205
|
<span class='object_link'><a href="Ballast/Concerns/Common.html#format_long_date-instance_method" title="Ballast::Concerns::Common#format_long_date (method)">#format_long_date</a></span>
|
194
206
|
<small>Ballast::Concerns::Common</small>
|
@@ -238,32 +250,32 @@
|
|
238
250
|
|
239
251
|
|
240
252
|
<li class="r2 ">
|
241
|
-
<span class='object_link'><a href="Ballast/Service.html#initialize-instance_method" title="Ballast::Service#initialize (method)">#initialize</a></span>
|
242
|
-
<small>Ballast::Service</small>
|
253
|
+
<span class='object_link'><a href="Ballast/Service/Response.html#initialize-instance_method" title="Ballast::Service::Response#initialize (method)">#initialize</a></span>
|
254
|
+
<small>Ballast::Service::Response</small>
|
243
255
|
</li>
|
244
256
|
|
245
257
|
|
246
258
|
<li class="r1 ">
|
247
|
-
<span class='object_link'><a href="Ballast/
|
248
|
-
<small>Ballast::
|
259
|
+
<span class='object_link'><a href="Ballast/Middlewares/DefaultHost.html#initialize-instance_method" title="Ballast::Middlewares::DefaultHost#initialize (method)">#initialize</a></span>
|
260
|
+
<small>Ballast::Middlewares::DefaultHost</small>
|
249
261
|
</li>
|
250
262
|
|
251
263
|
|
252
264
|
<li class="r2 ">
|
253
|
-
<span class='object_link'><a href="Ballast/
|
254
|
-
<small>Ballast::
|
265
|
+
<span class='object_link'><a href="Ballast/Service.html#initialize-instance_method" title="Ballast::Service#initialize (method)">#initialize</a></span>
|
266
|
+
<small>Ballast::Service</small>
|
255
267
|
</li>
|
256
268
|
|
257
269
|
|
258
270
|
<li class="r1 ">
|
259
|
-
<span class='object_link'><a href="Ballast/
|
260
|
-
<small>Ballast::
|
271
|
+
<span class='object_link'><a href="Ballast/Errors/Base.html#initialize-instance_method" title="Ballast::Errors::Base#initialize (method)">#initialize</a></span>
|
272
|
+
<small>Ballast::Errors::Base</small>
|
261
273
|
</li>
|
262
274
|
|
263
275
|
|
264
276
|
<li class="r2 ">
|
265
|
-
<span class='object_link'><a href="Ballast/
|
266
|
-
<small>Ballast::
|
277
|
+
<span class='object_link'><a href="Ballast/AjaxResponse.html#initialize-instance_method" title="Ballast::AjaxResponse#initialize (method)">#initialize</a></span>
|
278
|
+
<small>Ballast::AjaxResponse</small>
|
267
279
|
</li>
|
268
280
|
|
269
281
|
|
@@ -274,8 +286,8 @@
|
|
274
286
|
|
275
287
|
|
276
288
|
<li class="r2 ">
|
277
|
-
<span class='object_link'><a href="Ballast/
|
278
|
-
<small>Ballast::
|
289
|
+
<span class='object_link'><a href="Ballast/Configuration.html#initialize-instance_method" title="Ballast::Configuration#initialize (method)">#initialize</a></span>
|
290
|
+
<small>Ballast::Configuration</small>
|
279
291
|
</li>
|
280
292
|
|
281
293
|
|
@@ -103,7 +103,7 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on Fri Feb 6
|
106
|
+
Generated on Fri Feb 6 16:18:34 2015 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
108
|
0.8.7.6 (ruby-2.2.0).
|
109
109
|
</div>
|
data/lib/ballast/service.rb
CHANGED
@@ -98,9 +98,15 @@ module Ballast
|
|
98
98
|
# Marks the failure of the operation.
|
99
99
|
#
|
100
100
|
# @param details [Object] The error(s) occurred.
|
101
|
-
# @param on_validation [Boolean] Whether the error(s) was/were validation error(s).
|
102
101
|
def self.fail!(details, on_validation: false)
|
103
|
-
raise(
|
102
|
+
raise(Errors::Failure, details)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Marks the failure of the validation of the operation.
|
106
|
+
#
|
107
|
+
# @param details [Object] The error(s) occurred.
|
108
|
+
def self.fail_validation!(details)
|
109
|
+
raise(Errors::ValidationFailure, details)
|
104
110
|
end
|
105
111
|
|
106
112
|
# Creates a service object.
|
@@ -131,9 +137,15 @@ module Ballast
|
|
131
137
|
# Marks the failure of the operation.
|
132
138
|
#
|
133
139
|
# @param details [Object] The error(s) occurred.
|
134
|
-
|
135
|
-
|
136
|
-
|
140
|
+
def fail!(details)
|
141
|
+
raise(Errors::Failure, details)
|
142
|
+
end
|
143
|
+
|
144
|
+
# Marks the failure of the validation of the operation.
|
145
|
+
#
|
146
|
+
# @param details [Object] The error(s) occurred.
|
147
|
+
def fail_validation!(details)
|
148
|
+
raise(Errors::ValidationFailure, details)
|
137
149
|
end
|
138
150
|
|
139
151
|
# Handles a failure.
|
data/lib/ballast/version.rb
CHANGED
@@ -93,9 +93,11 @@ describe Ballast::Service do
|
|
93
93
|
it "should raise a failure" do
|
94
94
|
expect { DummyService.fail!("DETAILS") }.to raise_error(Ballast::Errors::Failure)
|
95
95
|
end
|
96
|
+
end
|
96
97
|
|
98
|
+
describe ".fail_validation!" do
|
97
99
|
it "should raise a validation failure" do
|
98
|
-
expect { DummyService.
|
100
|
+
expect { DummyService.fail_validation!("DETAILS") }.to raise_error(Ballast::Errors::ValidationFailure)
|
99
101
|
end
|
100
102
|
end
|
101
103
|
|
@@ -129,12 +131,14 @@ describe Ballast::Service do
|
|
129
131
|
end
|
130
132
|
|
131
133
|
describe "#fail!" do
|
132
|
-
it "should
|
133
|
-
|
134
|
-
|
135
|
-
|
134
|
+
it "should raise a failure" do
|
135
|
+
expect { DummyService.new.fail!("DETAILS") }.to raise_error(Ballast::Errors::Failure)
|
136
|
+
end
|
137
|
+
end
|
136
138
|
|
137
|
-
|
139
|
+
describe "#fail_validation!" do
|
140
|
+
it "should raise a validation failure" do
|
141
|
+
expect { DummyService.new.fail_validation!("DETAILS") }.to raise_error(Ballast::Errors::ValidationFailure)
|
138
142
|
end
|
139
143
|
end
|
140
144
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ballast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shogun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|