Conversation
… room number', and 'creates a list of twentyrooms'.
HotelWhat We're Looking For
|
lib/date_range.rb
Outdated
| attr_accessor :room_status, :start_date, :end_date | ||
|
|
||
| def res_start(start_time = '11:00'.strftime('%k%M')) | ||
| @res_start = res_start |
There was a problem hiding this comment.
I'm not sure what purpose this method is serving, it seems to do recursion.
lib/date_range.rb
Outdated
|
|
||
| def initialize(room_number, start_date_time, end_date_time) | ||
| @room_number = room_number | ||
| @start_date = start_date |
There was a problem hiding this comment.
Here you are setting @start_date to itself. It should probably be @start_date = start_date_time
| @@ -0,0 +1,24 @@ | |||
| class DateRange | |||
There was a problem hiding this comment.
The idea for this class is a really good idea, but the implementation doesn't make sense.
| end | ||
|
|
||
| def self.check_room_status | ||
| @booked_rooms = [] |
There was a problem hiding this comment.
Since this is a class method, you shouldn't need instance variables.
| @open_rooms = [] | ||
| @rooms.each do |number, status| | ||
| if :room_status == :Available | ||
| status = :Unavailable |
There was a problem hiding this comment.
A room won't be just available or unavailable. A room's availability depends on the date.
| # create module for reservations to hold classes | ||
| require 'pry' | ||
| require_relative 'hotel_admin.rb' | ||
| module Reservation |
There was a problem hiding this comment.
You should put each class in the same module. Grouping the classes into a common module is how we normally organize classes in our project.
| # create new class of Room, to create the block of rooms | ||
| class Room | ||
| attr_reader :room_number | ||
| attr_accessor :status |
There was a problem hiding this comment.
A room won't have a set status. The status will depend on the date as well.
| require_relative 'hotel_admin.rb' | ||
| module Reservation | ||
|
|
||
| class ReserveRoom |
There was a problem hiding this comment.
I would probably name this class Reservation
…initely understanding it much better
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions