Conversation
|
|
||
| end | ||
|
|
||
| def print_rooms |
There was a problem hiding this comment.
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.
I might move this sort of functionality into Block.
| attr_reader :number | ||
| attr_accessor :cost | ||
|
|
||
| def initialize(number, cost = 200) |
| 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.
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