Module: ClearLogic::Result::ClassMethdos
- Defined in:
- lib/clear_logic/result.rb
Instance Method Summary collapse
Instance Method Details
#errors(*errors_methods) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/clear_logic/result.rb', line 28 def errors(*errors_methods) errors_methods.each do |error_type| define_method(error_type) do |context| context.failure_error ||= ClearLogic::FailureError.new(error_type) failure(context) end private error_type end end |