lib/simple_validation.rb
def validate
    return if @validated ||= false

    @validated = true
    self.class.validation_methods.each do |method_name, conditions|
      public_send(method_name) if conditions.all? { |condition| public_send(condition) }
    end
  end
# Run all validations associated with the object
Run all validations associated with the object
Run all validations associated with the object
def validate
    return if @validated ||= false
    @validated = true
    self.class.validation_methods.each do |method_name, conditions|
      public_send(method_name) if conditions.all? { |condition| public_send(condition) }
    end
  end
def validate return if @validated ||= false @validated = true self . class . validation_methods . each do | method_name , conditions | public_send ( method_name ) if conditions . all? { | condition | public_send ( condition ) } end end
Run all validations associated with the object
Run all validations associated with the object