Conversation
…e and implemented methods.
…helper methods and attribute to determine.
… not required for user story nor helper method, same can be accomplisted using def list_available_rooms_by_date_range(date_range:).
…ry wants list of reserved rooms only (seems like to not include block) corresponding tests removed as well.
… blocks and added tests
HotelWhat We're Looking For
|
| end | ||
| block.set_number_available(rooms_collection.length) | ||
| rooms_collection.each do |room| | ||
| room.unavailable_list << block |
There was a problem hiding this comment.
This isn't a problem for this project, but if someone wanted to cancel a block, you'd have to find rooms with the block and delete that from each room. Just a little awkward.
| reservation.cost = room.cost_per_night * reservation.duration_in_days * (100 - percent_discount) / 100.0 | ||
| end | ||
|
|
||
| def get_cost_of_booking(reservation:) |
There was a problem hiding this comment.
This method's a little weird in that you're passing in a reservation and returning the cost of that reservation, which seems that this method is unnecessary.
| setup_rooms(rooms_to_set_up) | ||
| end | ||
|
|
||
| def setup_rooms(rooms_to_set_up) |
| rooms << RoomWrapper::room(cost: cost_per_night, room_number: rooms.length + 1) | ||
| end | ||
|
|
||
| def list_rooms(rooms_to_list: rooms) |
There was a problem hiding this comment.
Why is this method simply returning the object passed in as an argument?
|
|
||
| def find_unavailable_object(id:) | ||
| rooms.each do |room| | ||
| room.unavailable_list.each do |unavailable_object| |
There was a problem hiding this comment.
Unavailable how? A room might be available on a given day and unavailable the next.
| end | ||
| end | ||
|
|
||
| module RoomWrapper |
There was a problem hiding this comment.
I'm uncertain this RoomWrapper module serves much purpose.
| expect(valid_block.number_available).must_equal 0 | ||
| end | ||
|
|
||
| it "will check if room available, that is number_available < 0 will return false" do |
There was a problem hiding this comment.
So you don't raise an error if they try to reserve more rooms from a block than are in the block?
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions