Class: Validation::Rule::Decay
- Inherits:
-
StretchyRule
- Object
- StretchyRule
- Validation::Rule::Decay
- Defined in:
- lib/validation/rule/decay.rb
Constant Summary collapse
- DECAY_FUNCTIONS =
[:gauss, :linear, :exp]
Instance Method Summary collapse
Methods inherited from StretchyRule
#empty_ok?, #initialize, #invalid_empty?, #is_empty?, #params, #required?
Constructor Details
This class inherits a constructor from Validation::Rule::StretchyRule
Instance Method Details
#error_key ⇒ Object
6 7 8 |
# File 'lib/validation/rule/decay.rb', line 6 def error_key :decay_function 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 |