Class: Lite::Validation::Validator::Result::Refuted
- Inherits:
-
Abstract::Instance
- Object
- Abstract::Instance
- Lite::Validation::Validator::Result::Refuted
- Includes:
- Abstract::Failure
- Defined in:
- lib/lite/validation/validator/result/refuted.rb
Constant Summary
Constants included from Abstract
Class Method Summary collapse
Instance Method Summary collapse
- #auto_commit(as:) ⇒ Object
- #children ⇒ Object
- #commit(_value) ⇒ Object
- #committed? ⇒ Boolean
- #dispute(error) ⇒ Object
- #errors_root ⇒ Object
- #inspect ⇒ Object
- #navigable ⇒ Object
- #navigate(*_path, &_block) ⇒ Object
- #refute(error) ⇒ Object
- #refuted? ⇒ Boolean
- #success_at?(*_path) ⇒ Boolean
Methods included from Abstract::Failure
Methods included from Result::Abstract::Failure
Methods included from Result::Abstract
Class Method Details
.instance(error, *args, fall_through: false) ⇒ Object
15 16 17 18 19 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 15 def self.instance(error, *args, fall_through: false) raise Error::Fatal, "Structured error expected, got: #{error.inspect}" unless error.is_a?(StructuredError) new(error, *args, fall_through: fall_through) end |
Instance Method Details
#auto_commit(as:) ⇒ Object
39 40 41 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 39 def auto_commit(as:) self end |
#children ⇒ Object
67 68 69 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 67 def children EMPTY end |
#commit(_value) ⇒ Object
35 36 37 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 35 def commit(_value) self end |
#committed? ⇒ Boolean
27 28 29 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 27 def committed? false end |
#dispute(error) ⇒ Object
43 44 45 46 47 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 43 def dispute(error) raise Error, "Structured error expected, got: #{error.inspect}" unless error.is_a?(StructuredError) self end |
#errors_root ⇒ Object
63 64 65 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 63 def errors_root [error] end |
#inspect ⇒ Object
71 72 73 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 71 def inspect signature('Refuted', "error=#{error.code}") end |
#navigable ⇒ Object
55 56 57 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 55 def navigable self end |
#navigate(*_path, &_block) ⇒ Object
59 60 61 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 59 def navigate(*_path, &_block) self end |
#refute(error) ⇒ Object
49 50 51 52 53 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 49 def refute(error) raise Error::Fatal, "Structured error expected, got: #{error.inspect}" unless error.is_a?(StructuredError) self end |
#refuted? ⇒ Boolean
31 32 33 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 31 def refuted? true end |
#success_at?(*_path) ⇒ Boolean
23 24 25 |
# File 'lib/lite/validation/validator/result/refuted.rb', line 23 def success_at?(*_path) false end |