Conversation
…nitialize method approach
…tart_date, end_date
…o each other and within the user class
…l reservations for a given day
… start_date and end_date, and raises an exception for trying to reserve a room that has preexisting reservation in date range
… list of available rooms for a given date_range
…_date and it allows user to make new reservation on a room starting same day as another reservations end_date
…s what it's supposed....why?
…that still needs to be dealt with
… tests (so much refactoring to consider...)
… version of the Block Class
… user to include blocks within availibility
…ilable rooms in a block -- finished first attempt at all basic requirements for this assignment
…nitialize to use dependency injection instead and trying to separate other dependencies
CheezItMan
reviewed
Mar 19, 2018
lib/block.rb
Outdated
| class Block < Reservation | ||
| attr_reader :id, :reservations | ||
| def initialize(id, rooms, party, date_range, discount) | ||
| @id = id |
There was a problem hiding this comment.
You should be using super here. Nice work using inheritance however!
HotelWhat We're Looking For
|
CheezItMan
reviewed
Mar 19, 2018
| end | ||
| @rooms = rooms | ||
| @reservations = [] | ||
| @calendar = {} |
There was a problem hiding this comment.
Interesting idea having a hash of the reservation dates, very efficient.
… for first part of the Design Activity
…le, so the id isn't dependent on the length of the array, which might lead to duplicate ids
…oom instance's calendar
… date_range (more like adjusted the tests because that seemed to be the main use of the date_range)
…where in the code by other classes, so didn't need to change anything else
… interact with the room's instance variable for cost
…s design and what I tried to do to implement it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions