Class: Bambora::BatchUpload::MakeArray

Inherits:
Object
  • Object
show all
Defined in:
lib/bambora/batch_upload.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMakeArray

Returns a new instance of MakeArray.



55
# File 'lib/bambora/batch_upload.rb', line 55

def initialize; @array=[]; end

Instance Attribute Details

#arrayObject

Returns the value of attribute array.



54
55
56
# File 'lib/bambora/batch_upload.rb', line 54

def array
  @array
end

Instance Method Details

#push_into_file(params) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/bambora/batch_upload.rb', line 56

def push_into_file(params)
  validate_args params
  array << OpenStruct.new(txn_type:      params[:payment_type],
                          transit:       params[:transit_number].to_s,
                          institution:   params[:institution_number].to_s,
                          account:       params[:account_number].to_s,
                          amount:        params[:amount],
                          ref:           params[:reference].to_s,
                          recipient:     params[:recipient].to_s,
                          customer_code: params[:customer_code].to_s
                         )
end