simple-lang implementation of ng-banks
Install this module by running this command:
simple install.sim
Next, import the module and create a new child inheriting the parent class that'll give you access to the class methods.
// Import module
call NgBanks.NgBanks
block main()
bank = new NgBanks
// Get All Banks
bank.getBanks()
// Get A certain Bank - Guarantee Trust Bank
bank.getBank('GTB')
// Add A New Bank
bank.addBank('Bank of the Future', 427, 'BOF', '*404#')
The Module class contains three methods :
-
getBanks()
: This method returns all the banks in the module. -
getBank(param)
: This method returns the bank based on the bank code or slug passed as the method arg. It returns nothing if a matching bank doesn't exist. -
addBank(name, code, slug, ussd_code)
: This method extends the current bank list at that time. It doesn't have any effect on the main list situated insrc/NgBanks.sim
. An exception is throw if the new bank's slug or code matches an existing bank.
This module is authored by Abdulazeez Abdulazeez Adeshina
This small module is open contribution such as adding other banks in src/NgBanks.sim`.
- Write Tests