Class: Cure::Validator::CustomRule
Instance Method Summary
collapse
Methods inherited from BaseRule
#initialize
Instance Method Details
#custom_proc ⇒ Object
73
74
75
|
# File 'lib/cure/validator/base_rule.rb', line 73
def custom_proc
@options.fetch(:proc, proc { |_x| false })
end
|
#process(value) ⇒ Object
63
64
65
66
67
|
# File 'lib/cure/validator/base_rule.rb', line 63
def process(value)
return true if value.nil?
custom_proc.call(value)
end
|
#to_s ⇒ Object
69
70
71
|
# File 'lib/cure/validator/base_rule.rb', line 69
def to_s
"Custom"
end
|