-
Notifications
You must be signed in to change notification settings - Fork 49
Branches - Linnea #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…o statement at beginning of DateRange tests
HotelWhat We're Looking ForTest Inspection
Code Review
Overall FeedbackGreat work overall! You've built your first project with minimal starting code. This represents an incredible milestone in your journey, and you should be proud of yourself! I am particularly impressed by the way that you wrote clean, succinct code. I do see some room for improvement around testing more edge cases and committing more often. (And answering comprehension Qs) |
| #selects first available room for reservation, shovels into reservations array | ||
| #if there were no available rooms, the array would be empty! therefore, if the length of the array is 0, the program raises an ArgumentError. | ||
| #instructor helped me fix this code and the test in our 1:1 (had been returning a Hash) | ||
| def createReservation(room_number, date_range) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method isn't actually using the room_number param for anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn't actually need to give the user the ability to define which room number but it's bad to make the method look like it's allowing the user to specify the room number when it isn't.
| #she explained the single '&' is 'bitwise' code and is used more often in lower-level languages. It is comparing the object's date range array with the inputted object's date range array and pushes those similarities into an array. If they have no similarities (e.g. the array is empty), it returns false (indicating there is no overlap). If the array contains any dates, it returns true (indicating overlap) because the array will be filled with overlapping dates. | ||
| #typically 'other' is used, but for my understanding I used the parameter 'input' | ||
| def overlap?(input) | ||
| if self.createDateArray & input.createDateArray != [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool that your mentor showed you this! It's important for Ada that you understand in detail what the code you wrote is doing to the point you could come up with it on your own if given a similar assignment in the future. So if you understand this to that level of depth, that's great! I'm just calling that out because I'm having trouble understanding it tbh. Haha
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions