Module: ACH::Validations

Included in:
Component, Record::Base
Defined in:
lib/ach/validations.rb

Overview

This module hosts the most basic validations for both components and records. The only validation being performed is presence validation.

Instance Method Summary collapse

Instance Method Details

#errorsObject



29
30
31
# File 'lib/ach/validations.rb', line 29

def errors
  @errors || reset_errors!
end

#valid?Boolean

Returns:

  • (Boolean)


5
6
7
8
9
# File 'lib/ach/validations.rb', line 5

def valid?
  reset_errors!
  is_a?(Component) ? valid_component? : valid_record?
  errors.empty?
end