Account
This class handles validation and formatting of bank accounts to be used in Yakuza scripts
Requiring
Account = ;account = // Instance new account
Seters & getters
Setters and getters are functions with pattern matching, they behave as setters when an argument is given, otherwise they behave as getters.
Balance
Must be an Int or a Float
account;
Currency
Is a string, must be one of the following:
- international
- national
account;
Name
Must be a non-empty string
account.name('Super account');
Type
String, defaults to normal and must be one of the following:
- checking
- credit
- credit_line
- vista
accounttype'credit_line';
Uid and Vanity Uid
Must be a non-empty string
account; // This worksaccount; // This alias works too account;
Building the account
Once all attributes are set, you can use the build
method to get a formatted, ready-to-go account
object
account; // Returns {'name': 'Foo', 'balance': 0, ... }