This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| # Q1: “Add an error if the first_name field is an empty string” | |
| # Q2: “Change tax_owed so that it is calculated based on income minus ” | |
| def create_user(input) | |
| errors = [] | |
| if input.last_name == null || input.last_name == '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| def create_user(input) | |
| errors = [] | |
| if input.last_name == null || input.last_name == '' | |
| errors.push('last_name is required') | |
| else | |
| input.last_name = input.last_name.trim | |
| if input.last_name == '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UsefulClass { | |
| public function primaryMethod() { | |
| // Doing stuff | |
| // Doing stuff | |
| doNewMethod1(); | |
| doNewMethod2(); |