Module: Nacha::HasErrors

Included in:
AbaNumber
Defined in:
lib/nacha/has_errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



5
6
7
# File 'lib/nacha/has_errors.rb', line 5

def errors
  @errors
end

Instance Method Details

#add_error(message) ⇒ Object



7
8
9
10
# File 'lib/nacha/has_errors.rb', line 7

def add_error(message)
  @errors ||= []
  @errors << message
end

#has_errors?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/nacha/has_errors.rb', line 12

def has_errors?
  !@errors.nil? && !@errors.empty?
end