-
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
Amy Lee -- Carets #31
base: master
Are you sure you want to change the base?
Conversation
…older for potential future Reservation class methods inserted
…nality and basic tests; passing
…rough testing required, error handling, and edge case testing required
…o help return a list of all rooms available for a date range; passes a basic test that it will return the correct Boolean value
… an available room for a given date range. passes basic tests. design notes for possible refactoring included
…n optional requirement
… May change. Passing basic tests
…Room class, passing basic tests
…on object, and changed the order of the initialize arguments
…ndependent class. First attempt at implementing logic for making Block reservations, passing
…oom IDs only, not Room objects, for the purposes of figuring out method logic/figuring out how classes connect and effect each other. all tests passing; will probably change
…be more intuitive with design logic - HotelBooking module has a Hotel, which has Rooms, Reservations, Blocks, and Block Reservations, which in turn have dates
…all_dates variable and refactor/refine everything. Frurther testing needed
…nd blocks, and one array for all reserved dates. Hotel will hav methods to find reservations and blocks by IDs as needed
… class (booking system); all tests passing
HotelWhat We're Looking For
|
room.reserve_room(@check_in, @check_out, res_idx, guest_idx) | ||
|
||
guest_idx +=1 | ||
res_idx +=1 |
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.
at each iteration, because you're resetting the values of guest_idx
and res_idx
in lines 164 and 165, incrementing them here doesn't actually affect the code
Your tests pass because you aren't testing for this logic/asserting that the guest and res ids are set!
lib/Booking.rb
Outdated
room = HotelBooking::Room.new(i) | ||
standard_rooms << room | ||
i += 1 | ||
end |
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 can probably do this same thing with
NUM_STANDARD_ROOMS.times do |index|
room = HotelBooking::Room.new(index + 1)
standard_rooms << room
end
or
(1..NUM_STANDARD_ROOMS).each do |index|
instead of needing to increment with i if you wanted to
@id = id_number | ||
@nightly_rate = nightly_rate | ||
@type = :standard | ||
@reserv_ids = [] |
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.
What are @reserv_ids
for?
Hey Amy! Sorry that my review of your code took a long time. Overall, I'm really pleased with your I have questions about how you designed the I don't know how much you need |
|
||
end | ||
|
||
def check_valid_dates(check_in, check_out) |
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.
I love all the small helper methods you made :D I wish that there were a better place to put this specific helper method about checking if it's a valid date that wasn't in Hotel
, but I can't think of a better place at the moment.
end | ||
|
||
if check_out < check_in | ||
raise ArgumentError.new("Invalid Date Range: Check out date is earlier than check-in 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.
You might want to pick a different Error besides ArgumentError
(like even writing a custom Error!)
…lock are in the Block class instead of Room class
…onsibility implementation
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions