class method
self.kind
Ruby on Rails 3.0.20
Since v3.0.20Signature
self.kind()
Returns the kind of the validator.
Examples
PresenceValidator.kind # => :presence UniquenessValidator.kind # => :uniqueness
Source
# File activemodel/lib/active_model/validator.rb, line 108
def self.kind
@kind ||= name.split('::').last.underscore.sub(/_validator$/, '').to_sym unless anonymous?
end
Defined in activemodel/lib/active_model/validator.rb line 108
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Validator