Class: ActiveModel::Validations::BaseValidator
- Inherits:
-
Object
- Object
- ActiveModel::Validations::BaseValidator
- Defined in:
- lib/client_side_validations/rails_2/active_record/active_model/validations/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(attributes, options = {}) ⇒ BaseValidator
constructor
A new instance of BaseValidator.
- #kind ⇒ Object
Constructor Details
#initialize(attributes, options = {}) ⇒ BaseValidator
Returns a new instance of BaseValidator.
5 6 7 8 |
# File 'lib/client_side_validations/rails_2/active_record/active_model/validations/base.rb', line 5 def initialize(attributes, = {}) self.attributes = attributes self. = end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/client_side_validations/rails_2/active_record/active_model/validations/base.rb', line 3 def attributes @attributes end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/client_side_validations/rails_2/active_record/active_model/validations/base.rb', line 3 def @options end |
Class Method Details
.kind ⇒ Object
17 18 19 |
# File 'lib/client_side_validations/rails_2/active_record/active_model/validations/base.rb', line 17 def self.kind @kind ||= name.split('::').last.underscore.sub(/_validator$/, '').to_sym end |
Instance Method Details
#==(other) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/client_side_validations/rails_2/active_record/active_model/validations/base.rb', line 10 def ==(other) class_equality = self.class == other.class attribute_equality = self.attributes == other.attributes = self. == other. class_equality && attribute_equality && end |
#kind ⇒ Object
21 22 23 |
# File 'lib/client_side_validations/rails_2/active_record/active_model/validations/base.rb', line 21 def kind self.class.kind end |