Class: Reform::Form::ActiveModel::Validations::Validator
Class Method Summary
collapse
Instance Method Summary
collapse
#build_errors, included, #read_attribute_for_validation
Constructor Details
#initialize(form, name) ⇒ Validator
Returns a new instance of Validator.
58
59
60
61
|
# File 'lib/reform/form/active_model/validations.rb', line 58
def initialize(form, name)
super(form)
self.class.model_name = name end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
63
64
65
|
# File 'lib/reform/form/active_model/validations.rb', line 63
def method_missing(m, *args, &block)
__getobj__.send(m, *args, &block) end
|
Class Method Details
.clone ⇒ Object
53
54
55
|
# File 'lib/reform/form/active_model/validations.rb', line 53
def clone
Class.new(self)
end
|
.model_name ⇒ Object
45
46
47
|
# File 'lib/reform/form/active_model/validations.rb', line 45
def model_name
@_active_model_sucks || ActiveModel::Name.new(Reform::Form, nil, "Reform::Form")
end
|
.model_name=(name) ⇒ Object
49
50
51
|
# File 'lib/reform/form/active_model/validations.rb', line 49
def model_name=(name)
@_active_model_sucks = name
end
|