Class: BuckarooClient::Gateway::Batch
- Inherits:
-
Object
- Object
- BuckarooClient::Gateway::Batch
- Extended by:
- Forwardable
- Defined in:
- lib/buckaroo_client/gateway/batch.rb
Instance Attribute Summary collapse
-
#transactions ⇒ Object
readonly
Returns the value of attribute transactions.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Batch
constructor
A new instance of Batch.
- #to_csv ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Batch
Returns a new instance of Batch.
12 13 14 |
# File 'lib/buckaroo_client/gateway/batch.rb', line 12 def initialize(args = {}) @transactions = args.fetch(:transactions, []) end |
Instance Attribute Details
#transactions ⇒ Object (readonly)
Returns the value of attribute transactions.
7 8 9 |
# File 'lib/buckaroo_client/gateway/batch.rb', line 7 def transactions @transactions end |
Instance Method Details
#to_csv ⇒ Object
16 17 18 19 20 |
# File 'lib/buckaroo_client/gateway/batch.rb', line 16 def to_csv table = CSV::Table.new([]) transactions.each { |t| table << transaction_to_csv(t) } table.to_csv(col_sep: ';') end |