Class: Sequel::Model::Validations::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/sequel/model/validations.rb

Instance Method Summary collapse

Constructor Details

#initialize(model_class, &block) ⇒ Generator

Returns a new instance of Generator.



88
89
90
91
# File 'lib/sequel/model/validations.rb', line 88

def initialize(model_class ,&block)
  @model_class = model_class
  instance_eval(&block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



93
94
95
96
# File 'lib/sequel/model/validations.rb', line 93

def method_missing(method, *args)
  method = :"validates_#{method}"
  @model_class.send(method, *args)
end