-
Notifications
You must be signed in to change notification settings - Fork 50
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
Branches, Kristy #47
base: master
Are you sure you want to change the base?
Branches, Kristy #47
Conversation
|
||
end | ||
|
||
def print_rooms |
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'd avoid using print
in the names of methods that return strings, since people might think it outputs the string to the terminal instead.
|
||
end | ||
|
||
def avail_from_block(block_id) |
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 might move this sort of functionality into Block
.
attr_reader :number | ||
attr_accessor :cost | ||
|
||
def initialize(number, cost = 200) |
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.
Good use of a default value!
avail_rooms = @rooms.select { |room| taken_rooms.include?(room) == false } | ||
|
||
if avail_rooms.length == 0 | ||
raise ArgumentError.new("There are no hotel rooms avaialbe for that time frame") |
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 should probably be a StandardError
or a custom error since it's raised because of the state of your program, not the arguments themselves.
(Most of our examples use ArgumentError
so this was a pretty common mistake and we'll clarify the point for next cohort.)
HotelWhat We're Looking ForTest Inspection
Code Review
Overall FeedbackGreat work overall! You've built your first project with minimal starting code. This represents an incredible milestone in your journey, and you should be proud of yourself! I am particularly impressed by the way that you handled blocks. Those are really hard to get right and are definitely the trickiest part of this assignment. There were a few little things wrong with your submission but nothing big aside from the missing |
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions