Class: Varify::Rules::BetweenRule
- Inherits:
-
Rule
- Object
- Rule
- Varify::Rules::BetweenRule
show all
- Defined in:
- lib/varify/rules/between.rb
Instance Method Summary
collapse
Methods inherited from Rule
#initialize
Instance Method Details
#error_message ⇒ Object
10
11
12
|
# File 'lib/varify/rules/between.rb', line 10
def error_message
"#{@name} (:#{@key}) must be between '#{@options.first}' and '#{@options.last}'"
end
|
#valid? ⇒ Boolean
6
7
8
|
# File 'lib/varify/rules/between.rb', line 6
def valid?
@value.between?(@options.first,@options.last)
end
|