Module: Doorkeeper::Validations

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorObject

Returns the value of attribute error


5
6
7
# File 'lib/doorkeeper/validations.rb', line 5

def error
  @error
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)

15
16
17
18
# File 'lib/doorkeeper/validations.rb', line 15

def valid?
  validate
  @error.nil?
end

#validateObject


7
8
9
10
11
12
13
# File 'lib/doorkeeper/validations.rb', line 7

def validate
  @error = nil
  self.class.validations.each do |validation|
    break if @error
    @error = validation.last unless send("validate_#{validation.first}")
  end
end