Class: Validation::Generator

Class | Validation::Generator
In: | lib/assistance/validation.rb
Parent: | Object

The Generator class is used to generate validation definitions using the validates {} idiom.

### Methods

method_missing new

### Public Class methods

new(receiver ,&block)

Initializes a new generator.

[Source]

        # File lib/assistance/validation.rb, line 80
    80:     def initialize(receiver ,&block)
    81:       @receiver = receiver
    82:       instance_eval(&block)
    83:     end

### Public Instance methods

method_missing(m, *args, &block)

Delegates method calls to the receiver by calling receiver.validates_xxx.

[Source]

        # File lib/assistance/validation.rb, line 86
    86:     def method_missing(m, *args, &block)
    87:       @receiver.send("validates_#{m}""validates_#{m}", *args, &block)
    88:     end

[Validate]