Class: Rulix::Validators::AllowNilValidator
- Inherits:
-
Object
- Object
- Rulix::Validators::AllowNilValidator
- Defined in:
- lib/rulix/validators/allow_nil_validator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.to_proc ⇒ Object
6 7 8 |
# File 'lib/rulix/validators/allow_nil_validator.rb', line 6 def self.to_proc new.method(:call) end |
Instance Method Details
#call(val) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rulix/validators/allow_nil_validator.rb', line 10 def call val if val.nil? raise AllowableNil else true end end |