Sha256: 035d2752fa528df4616fd8d1566abeb4a8536a894d2a041c3e92d8b60c0ea851
Contents?: true
Size: 900 Bytes
Versions: 11
Compression:
Stored size: 900 Bytes
Contents
module StarkitBanking module API class Factory def self.get_client(model, action = nil) klass = model.class.name.demodulize case klass when 'Payment' if action.nil? svc = model.transfer_type == 'IMT' ? 'IMT' : 'FT2' return "StarkitBanking::#{model.payment_account.bank_name}::Payment::By#{svc}".constantize.new(model.transfer_type) else return "StarkitBanking::#{model.payment_account.bank_name}::Payment::#{action}".constantize.new(action) end when 'PaymentAccount' return "StarkitBanking::#{model.bank_name}::Account::#{action}".constantize.new(action) when 'BankBeneficiary' return "StarkitBanking::#{model.bank_name}::Beneficiary::#{model.transfer_type}::#{action}".constantize.new(action) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems