Class: Moon::Validator::Presence

Inherits:
Object
  • Object
show all
Defined in:
lib/moon/validator/presence.rb

Overview

Value presence validator.

Instance Method Summary collapse

Instance Method Details

#messages(value, context) ⇒ Object



5
6
7
8
# File 'lib/moon/validator/presence.rb', line 5

def messages(value, context)
  @value = value
  blank? ? [ "Must be present." ] : [ ]
end