Class: Varify::Rules::RequiredRule
- Inherits:
-
Rule
- Object
- Rule
- Varify::Rules::RequiredRule
show all
- Defined in:
- lib/varify/rules/required.rb
Instance Method Summary
collapse
Methods inherited from Rule
#initialize
Instance Method Details
#error_message ⇒ Object
14
15
16
|
# File 'lib/varify/rules/required.rb', line 14
def error_message
"#{@name} (:#{@key}) is required"
end
|
#valid? ⇒ Boolean
6
7
8
9
10
11
12
|
# File 'lib/varify/rules/required.rb', line 6
def valid?
if @options
!@value.nil?
else
true
end
end
|