class Sequel::Plugins::ValidationHelpersBlock::ValidationHelpersAttributesBlock

DSL class used directly inside the validates block. Methods without an explicit receiver that are called inside the block are assumed to be attributes of the object that need to be validated.

Public Class Methods

new(obj, &block) click to toggle source

Set the object being validated and instance_eval the block.

   # File lib/sequel/plugins/validation_helpers_block.rb
40 def initialize(obj, &block)
41   @obj = obj
42   instance_eval(&block)
43 end

Public Instance Methods

method_missing(m, &block) click to toggle source

Create a new ValidationHelpersValidationsBlock object using the stored object and given attribute name.

   # File lib/sequel/plugins/validation_helpers_block.rb
47 def method_missing(m, &block)
48   ValidationHelpersValidationsBlock.new(@obj, m, &block)
49 end