lib/ach_builder.rb in ach_builder-0.0.2 vs lib/ach_builder.rb in ach_builder-0.2.1

- old
+ new

@@ -1,41 +1,28 @@ +require 'active_support/concern' +require 'active_support/dependencies/autoload' require 'active_support/inflector' require 'active_support/ordered_hash' +require 'active_support/core_ext/module/delegation' +require 'active_support/core_ext/module/attribute_accessors' +require 'active_support/core_ext/class/attribute' require "ach/version" -require 'ach/constants' -require 'ach/formatter' -require 'ach/validations' -require 'ach/component' -require 'ach/record' -require 'ach/entry' -require 'ach/tail' -require 'ach/batch' -require 'ach/batch/header' -require 'ach/batch/control' -require 'ach/file' -require 'ach/file/header' -require 'ach/file/control' - +# Support for building the files necessary for the bulk exchange of debits and +# credits with financial institutions via the Automated Clearing House system, +# governed by NACHA ( http://www.nacha.org/ ). module ACH - def self.sample_file - File.new(:company_id => '11-11111', :company_name => 'MY COMPANY') do - immediate_dest '123123123' - immediate_dest_name 'COMMERCE BANK' - immediate_origin '123123123' - immediate_origin_name 'MYCOMPANY' - - ['WEB', 'TEL'].each do |code| - batch(:entry_class_code => code, :company_entry_descr => 'TV-TELCOM') do - effective_date Time.now.strftime('%y%m%d') - origin_dfi_id "00000000" - entry :customer_name => 'JOHN SMITH', - :customer_acct => '61242882282', - :amount => '2501', - :routing_number => '010010101', - :bank_account => '103030030' - end - end - end + extend ActiveSupport::Autoload + + autoload :Constants + autoload :Formatter + autoload :Validations + autoload :Component + autoload :Record + autoload :Batch + autoload :File + + def self.to_const(name) + [self, self::Record].detect{ |mod| mod.const_defined?(name) }.const_get(name) end end