Conversation
…split rooms into availble and booked
HotelWhat We're Looking For
|
| @@ -0,0 +1 @@ | |||
| WHERE IS ADA? | |||
There was a problem hiding this comment.
Here!
1215 4th Ave
Suite 1050
Seattle, WA 98161
| @blocks = [] | ||
|
|
||
| @reservations.each do |reservation| | ||
| overlap = reservation.dates & days |
There was a problem hiding this comment.
This won't work unless days has an exact date of a reservation. So this requires your reservations to keep all the dates it's reserved.
However doing it this way does make & work, clever.
You also will need to consider rooms in blocks however.
|
|
||
| admin.book_room(res1) | ||
|
|
||
| admin.rooms.length.must_equal free_rooms - 1 |
There was a problem hiding this comment.
This test doesn't make sense, the number of rooms doesn't change when a room is booked, the number of free rooms in a date range would change.
| @reservations.each do |reservation| | ||
| overlap = reservation.dates & days | ||
| if overlap.length > 0 | ||
| @rooms.pop |
There was a problem hiding this comment.
Removing the room from the list doesn't make sense, since when I book a room the hotel doesn't lose a room permanently.
lib/admin.rb
Outdated
| book_room(reservation) | ||
| end | ||
|
|
||
| def create_block_of_rooms(reservation, num_rooms) |
There was a problem hiding this comment.
What about:
- Creating a block with a discounted room rate.
- Is a block a
Reservation? - Is a room really reserved, if it's in the block, or is it just being held for later?
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions