Sha256: 66bdd99221cfb43f663351085c5e16500f5dd24a46de56352d9caf4d927ee96f

Contents?: true

Size: 495 Bytes

Versions: 3

Compression:

Stored size: 495 Bytes

Contents

module Charon
  module Helpers

    # Validates the datas passed as parameter with a Phenix::Validator and the given instructions.
    # @param  [Hash] the parameters to validate with the given instructions.
    # @param  [Proc] the instructions to apply on the validator.
    # @return [Hash] the validated and filtered datas.
    def validate(datas, &block)
      validator = Phenix::Validator.new(datas)
      validator.instance_eval(&block)
      return validator.filtered
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kharon-0.1.0 lib/validate.rb
kharon-0.0.3 lib/validate.rb
kharon-0.0.2 lib/validate.rb