{"id":15463541,"url":"https://github.com/cored/atm","last_synced_at":"2026-06-28T05:31:11.293Z","repository":{"id":216857068,"uuid":"742532157","full_name":"cored/atm","owner":"cored","description":"Small toy project to experiment with Ruby","archived":false,"fork":false,"pushed_at":"2024-01-14T02:02:29.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-21T12:35:09.934Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cored.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-12T17:32:05.000Z","updated_at":"2024-01-12T17:33:19.000Z","dependencies_parsed_at":"2024-10-02T00:21:56.147Z","dependency_job_id":"3e65276f-7f2b-4ce3-b301-c1528131735d","html_url":"https://github.com/cored/atm","commit_stats":null,"previous_names":["cored/atm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cored/atm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cored%2Fatm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cored%2Fatm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cored%2Fatm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cored%2Fatm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cored","download_url":"https://codeload.github.com/cored/atm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cored%2Fatm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34878963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T00:21:49.600Z","updated_at":"2026-06-28T05:31:11.257Z","avatar_url":"https://github.com/cored.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Automated Teller Machine - ATM\n\nWe've embarked on the journey to create a speculative new bank, and our mission is to implement a simple ATM machine. The ATM comprises two crucial components:\n\n1. **Register**: Keeps track of the physical cash on hand within the ATM machine.\n2. **Terminal**: Enables customers to access their account, view their balance, and withdraw cash.\n\n### Your Mission\n\nThe initial parts of the terminal UI prompt for a customer's account number. Once entered and found, we'd like to provide three options to the customer:\n\n1. **Show Balance**: Displays the current balance for the customer.\n2. **Withdraw Cash**: Prompts for the amount they wish to withdraw, following certain rules.\n3. **Exit**: Returns the UI to the main terminal.\n\nWe need your help to complete the functionality of our ATM machine.\n\n### Rules\n\n1. Do not allow withdrawals exceeding $500 at a time.\n2. Do not permit withdrawals exceeding the available balance in the account.\n3. Manage remaining bills in the register – if a customer requests $200 and only one $100 bill remains, they should receive that $100 and smaller bills for the remaining balance.\n4. Alert the customer if there's insufficient money in the register or in their account for the withdrawal.\n\n### Admin Access\n\nFor added security, bank tellers can access super-secret internal account details by entering `admin` into the account number prompt. This grants access to the overall balance of the register, including the number of each respective bill.\n\nThe possible bills in the register are $1, $5, $10, $20, $50, and $100.\n\n### Running the ATM\n\nTo run the ATM, execute the following command in your terminal:\n\n```bash\nruby atm.rb\n```\n\n### Running the Tests\n\nTo run the tests, execute the following command in your terminal:\n\n```bash\nrspec\n```\n\n### Implementation and Architecture\n\nThe implementation follows a modular structure with distinct classes for the Account, Register, and AutomatedTellerMachine. The ATM relies on user input to navigate through account details, display balances, and facilitate cash withdrawals.\n\n### Trade-offs and Potential Improvements\n\n1. **User Experience**: Enhancements in the user interface and experience could be implemented for a more intuitive interaction.\n2. **Error Handling**: Implement more detailed error messages to guide users in case of invalid inputs.\n3. **Code Refactoring**: Continuously refactor code to adhere to best practices and improve maintainability.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcored%2Fatm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcored%2Fatm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcored%2Fatm/lists"}