Class: FormKeeper::Constraint::AlnumSpace

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

Instance Method Summary collapse

Instance Method Details

#validate(value, arg) ⇒ Object



233
234
235
236
237
# File 'lib/formkeeper.rb', line 233

def validate(value, arg)
  result = value =~ /^[[:alnum:][:space:]]+$/
  result = !result if !arg
  !!result
end