Class: Macros::Error::SetFromContract
- Defined in:
- lib/macros/error/set_from_contract.rb
Overview
Set error messages in the context using contract errors
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Macros::Base
Instance Method Details
#call(ctx) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/macros/error/set_from_contract.rb', line 10 def call(ctx, **) = ctx['contract.default']&.errors&. return false unless ctx[:error_messages] = !!ctx[:error_messages] end |