Module: Doorkeeper::Validations
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/doorkeeper/validations.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
Instance Method Summary collapse
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
7 8 9 |
# File 'lib/doorkeeper/validations.rb', line 7 def error @error end |
Instance Method Details
#valid? ⇒ Boolean
18 19 20 21 |
# File 'lib/doorkeeper/validations.rb', line 18 def valid? validate @error.nil? end |
#validate ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/doorkeeper/validations.rb', line 9 def validate @error = nil self.class.validations.each do |validation| @error = validation[:options][:error] unless send("validate_#{validation[:attribute]}") break if @error end end |