Class: FormKeeper::Constraint::Custom

Inherits:
Base
  • Object
show all
Defined in:
lib/formkeeper.rb

Instance Method Summary collapse

Constructor Details

#initialize(block) ⇒ Custom

Returns a new instance of Custom.



92
93
94
# File 'lib/formkeeper.rb', line 92

def initialize(block)
  @custom = block
end

Instance Method Details

#validate(value, arg) ⇒ Object



95
96
97
# File 'lib/formkeeper.rb', line 95

def validate(value, arg)
  @custom.call(value, arg) 
end