-
Notifications
You must be signed in to change notification settings - Fork 45
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
Isabel Suchanek -- Carets #25
base: master
Are you sure you want to change the base?
Conversation
HotelWhat We're Looking For
|
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.
Just a few observations.
end | ||
|
||
def <=>(other_room) | ||
room_num <=> other_room.room_num |
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.
Nice!
lib/room.rb
Outdated
|
||
private | ||
|
||
def array_include_date?(array, start_date, end_date) |
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 is a little too generic, what is the array
parameter supposed to be?
It is however very DRY.
return room.reserve(check_in, check_out, discounted_rate) | ||
end | ||
|
||
def self.all |
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.
Good following of the existing pattern, it makes it easier to add a CSV or database later.
lib/hotel.rb
Outdated
|
||
end | ||
|
||
def reserve(start_date, end_date, room) |
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.
Just an observation, a user would need to identify a room object first before trying to reserve it. Why not just have them provide a room number and have this method first find the room.
That way the user doesn't have to know about Room objects or the Room class.
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions