Class: Rulix::Validators::AllowNilValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/rulix/validators/allow_nil_validator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.to_procObject



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