class Sequel::Plugins::ValidationClassMethods::ClassMethods::Generator

  1. lib/sequel/plugins/validation_class_methods.rb
Superclass: Object

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

Methods

Public Class

  1. new

Public Instance

  1. method_missing
  2. respond_to_missing?

Public Class methods

new(receiver ,&block)

Initializes a new generator.

[show source]
   # File lib/sequel/plugins/validation_class_methods.rb
57 def initialize(receiver ,&block)
58   @receiver = receiver
59   instance_exec(&block)
60 end

Public Instance methods

method_missing(m, *args, &block)

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

[show source]
   # File lib/sequel/plugins/validation_class_methods.rb
63 def method_missing(m, *args, &block)
64   @receiver.send(:"validates_#{m}", *args, &block)
65 end
respond_to_missing?(meth, include_private)

This object responds to all validates_* methods the model responds to.

[show source]
   # File lib/sequel/plugins/validation_class_methods.rb
68 def respond_to_missing?(meth, include_private)
69   @receiver.respond_to?(:"validates_#{meth}", include_private)
70 end