Method: ACH::Component.method_missing

Defined in:
lib/ach/component.rb

.method_missing(meth, *args) ⇒ Object

Uses method_missing pattern to specify default attributes for a Component. If method name is one of the defined rules, saves it to default_attributes hash.

These attributes are passed to inner components in a cascade way, i.e. when ACH File was defined with default value for ‘company_name’, this value will be passed to every Batch component within file, and from every Batch to corresponding batch header record.

Note that default values may be overwritten when building records.

Parameters:

  • meth (Symbol)
  • args (*Object)


59
60
61
62
63
64
65
# File 'lib/ach/component.rb', line 59

def self.method_missing(meth, *args)
  if Formatter.defined?(meth)
    default_attributes[meth] = args.first
  else
    super
  end
end