Class: Validation::Rule::Decay
- Inherits:
-
Object
- Object
- Validation::Rule::Decay
- Defined in:
- lib/validation/rule/decay.rb
Constant Summary collapse
- DECAY_FUNCTIONS =
[:gauss, :linear, :exp]
Instance Method Summary collapse
Instance Method Details
#error_key ⇒ Object
6 7 8 |
# File 'lib/validation/rule/decay.rb', line 6 def error_key :decay_function end |
#params ⇒ Object
14 15 16 |
# File 'lib/validation/rule/decay.rb', line 14 def params {} end |
#valid_value?(value) ⇒ Boolean
10 11 12 |
# File 'lib/validation/rule/decay.rb', line 10 def valid_value?(value) DECAY_FUNCTIONS.any?{|f| f == value || f.to_s == value } end |