salesking/sepa_king — pull request #28 by edwinv (2014-02-19 12:10:15+00:00)
Title: Get final batch id from SEPA message

This pull request contains changes to provide the batch id of a certain transaction. The batch id is used in bank transactions to reference a certain batch in a SEPA message.

Added are two extra methods for a `SEPA::Message`:

1. `SEPA::Message#batch_id(transaction_reference)`: fetches the batch id of the transaction with the given reference
2. `SEPA::Message#batches`: returns an array with the batch ids of the batch in the current file

For a successful implementation of these methods, a refactor was required. Transactions are now stored in groups right after adding a transaction with `add_transaction`. For backward compatibility, it is still possible to get all transactions across all batches by calling the `transactions` method.