-
Notifications
You must be signed in to change notification settings - Fork 50
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
Leaves - Emily Vomacka #26
base: master
Are you sure you want to change the base?
Conversation
…hod, wave 2 complete
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 called out your edge cases specifically in your tests and were very thoughtful about splitting code up into methods. I do see some room for improvement around modules, and also your date handling is a bit wonky. But really, those are quite small things, well done! |
class DateRange | ||
attr_reader :start_date, :end_date, :range | ||
|
||
def initialize(start_year, start_month, start_day, end_year, end_month, end_day) |
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.
It's reasonable to just accept to Date
objects here and require the user to do the parsing/building themselves.
end | ||
block_rooms = available_rooms(block_range).sample(room_quantity) | ||
if block_rooms.length < room_quantity | ||
raise ArgumentError, "The hotel does not have a sufficient number of empty rooms to book this block." |
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.
Since there's nothing wrong with the arguments themselves this shouldn't be an ArgumentError
; the user can't change their arguments to make a room available.
This should be a custom error or something like a StandardError
.
-Track reservations in a hash using name as a key, to make look up faster | ||
-Figure out how to eliminate reservations from past dates, so the system doesn't become overloaded as time progresses. | ||
-Allow more aspects of a reservation to be edited. (change stay duration, for example) | ||
-Eliminate or reduce dependencies as I understand them more |
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.
It's impossible to eliminate dependencies unless you put everything in one file. Dependencies are okay, it's just important to be mindful when you decide to add one since they have a cost.
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions