Class: Errapi::Validations::Presence::Implementation
- Defined in:
- lib/errapi/validations/presence.rb
Instance Method Summary collapse
Methods inherited from Base
#actual_option_value, #callable_option_type_error, #callable_option_value?, #callable_option_value_error, #exactly_one_option?, #initialize
Constructor Details
This class inherits a constructor from Errapi::Validations::Base
Instance Method Details
#validate(value, context, options = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/errapi/validations/presence.rb', line 5 def validate value, context, = {} if reason = check(value, .fetch(:value_set, true)) context.add_error reason: reason end end |