Class: Varify::Rules::BetweenRule

Inherits:
Rule
  • Object
show all
Defined in:
lib/varify/rules/between.rb

Instance Method Summary collapse

Methods inherited from Rule

#initialize

Constructor Details

This class inherits a constructor from Varify::Rules::Rule

Instance Method Details

#error_messageObject



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

Returns:

  • (Boolean)


6
7
8
# File 'lib/varify/rules/between.rb', line 6

def valid?
  @value.between?(@options.first,@options.last)
end