Module: Kharon::Helpers
- Defined in:
- lib/kharon/helpers.rb,
lib/kharon/helpers/validate.rb
Overview
This module contains helpers made for Rails or Sinatra applications and using the Kharon validator.
Instance Method Summary (collapse)
-
- (Hash) validate(datas, &block)
Validates the datas passed as parameter with a Phenix::Validator and the given instructions.
Instance Method Details
- (Hash) validate(datas, &block)
Validates the datas passed as parameter with a Phenix::Validator and the given instructions.
8 9 10 11 12 |
# File 'lib/kharon/helpers/validate.rb', line 8 def validate(datas, &block) validator = Kharon::Validator.new(datas) validator.instance_eval(&block) return validator.filtered end |