Module: Reform::Validation

Included in:
Contract
Defined in:
lib/reform/validation.rb,
lib/reform/validation/groups.rb

Overview

Adds ::validates and friends, and #valid? to the object. This is completely form-independent.

Defined Under Namespace

Modules: ClassMethods Classes: Groups

Constant Summary collapse

NoValidationLibraryError =
Class.new(RuntimeError)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(includer) ⇒ Object



37
38
39
# File 'lib/reform/validation.rb', line 37

def self.included(includer)
  includer.extend(ClassMethods)
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/reform/validation.rb', line 41

def valid?
  validate({})
end