Installation
Before using the generator, install the bankscrap gem:Generating an Adapter
Run the generator
Use the Replace
bankscrap generate_adapter command with your bank’s name:BankName with your bank’s name (e.g., HSBC, ChaseBank, WellsFargo).Generated Files
Gemspec File
The.gemspec file contains the gem metadata. Update the following fields:
spec.authors- Your namespec.email- Your email addressspec.summary- A brief description of the adapterspec.homepage- GitHub repository URL
Bank Implementation File
The mainbank.rb file includes:
- Endpoint constants - Define your API URLs
- REQUIRED_CREDENTIALS - Specify what credentials are needed
- initialize - Constructor for custom setup
- login - Authentication method
- fetch_accounts - Retrieve user accounts
- fetch_transactions_for - Get account transactions
- fetch_loans - (Optional) Retrieve loans
- fetch_cards - (Optional) Retrieve credit cards
- Builder methods - Convert API data to BankScrap objects
README Template
The generated README includes:- Installation instructions
- Usage examples (CLI and Ruby)
- Credential requirements
- Contributing guidelines
The generator uses Thor templates with variable interpolation. Your bank name is automatically converted to the correct format (dasherized for file names, module case for Ruby modules).
Name Formatting
The generator automatically handles name formatting:| Input | Gem Name | Module Name | File Path |
|---|---|---|---|
HSBC | bankscrap-hsbc | Bankscrap::HSBC | lib/bankscrap/hsbc/bank.rb |
ChaseBank | bankscrap-chase-bank | Bankscrap::ChaseBank | lib/bankscrap/chase-bank/bank.rb |
WellsFargo | bankscrap-wells-fargo | Bankscrap::WellsFargo | lib/bankscrap/wells-fargo/bank.rb |
Next Steps
After generating your adapter:- Define credentials - Update
REQUIRED_CREDENTIALSconstant - Implement login - Add authentication logic
- Fetch accounts - Implement account retrieval
- Fetch transactions - Implement transaction retrieval
- Test thoroughly - Ensure all methods work correctly
- Publish - Push to GitHub and share with the community
Getting Help
If you need assistance while building your adapter:- Check existing adapters for examples: bankscrap-bbva, bankscrap-ing
- Open an issue on GitHub
- Reference the generated template code comments