Class: PayoneerCsv::Csv
- Inherits:
-
Object
- Object
- PayoneerCsv::Csv
- Defined in:
- lib/payoneer_csv/csv.rb
Instance Attribute Summary collapse
-
#transactions ⇒ Object
readonly
Returns the value of attribute transactions.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(transactions) ⇒ Csv
constructor
A new instance of Csv.
Constructor Details
#initialize(transactions) ⇒ Csv
Returns a new instance of Csv.
6 7 8 |
# File 'lib/payoneer_csv/csv.rb', line 6 def initialize(transactions) @transactions = transactions end |
Instance Attribute Details
#transactions ⇒ Object (readonly)
Returns the value of attribute transactions.
4 5 6 |
# File 'lib/payoneer_csv/csv.rb', line 4 def transactions @transactions end |
Instance Method Details
#generate ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/payoneer_csv/csv.rb', line 10 def generate CSV.generate do |csv| csv << ['Transaction Date', 'Description', 'Amount', 'Currency'] transactions.each do |transaction| csv << row_for(transaction) end end end |