-
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
&& Brittany Jones Ampers #33
base: master
Are you sure you want to change the base?
Conversation
HotelWhat We're Looking For
|
@@ -0,0 +1,51 @@ | |||
require_relative 'reservation' | |||
|
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 should have a module as well.
else | ||
|
||
@rooms.each do |room| | ||
room_number = rooms.sample |
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.
Why pick a random room each time?
@rooms.each do |room| | ||
room_number = rooms.sample | ||
reservations.each do |reservation| | ||
if reservation_overlap?(reservation) == true |
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.
huh?
def reservation_overlap?(reservation) | ||
check_in = reservation.check_in | ||
check_out = reservation.check_out | ||
return false if check_in >= check_out || check_out <= check_in |
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 doesn't seem to make sense. You're checking to see if the reservation's check in date is after the check-out date. Shouldn't that be in the Reservation class? Also why is find_available_room
calling this method?
end | ||
|
||
def one_night | ||
if days_reserved - 1 == 0 |
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.
Why is this method here?
@reservations = [] | ||
end | ||
|
||
def find_available_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.
Find an available room on what date? How can you know if a room is available if you don't know when.
describe 'can get list of reservations' do | ||
|
||
it "will list all reservations during the time given" do | ||
hotel = Hotel.new |
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 also need to test when it can't get a reservation, if all the rooms are reserved on a given date.
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions