Module: Hanami::Validations::Form

Defined in:
lib/hanami/validations/form.rb

Overview

Validations mixin for forms/HTTP params.

This must be used when the input comes from a browser or an HTTP endpoint. It knows how to deal with common data types, and common edge cases like blank strings.

Examples:

require 'hanami/validations/form'

class Signup
  include Hanami::Validations::Form
end

Since:

  • 0.6.0

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Override Ruby’s hook for modules.

Parameters:

  • base (Class)

    the target action

See Also:

Since:

  • 0.6.0



27
28
29
30
31
32
# File 'lib/hanami/validations/form.rb', line 27

def self.included(base)
  base.class_eval do
    include Validations
    extend  ClassMethods
  end
end