Skip to content
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

Carets - Maria - Hotel #35

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Carets - Maria - Hotel #35

wants to merge 22 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Sep 11, 2017

Hotel

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a design decision you had to make when working on this project. What options were you considering? What helped you make your final decision? I had to decide whether to create a hotel class. I probably spent way too much time on Friday trying to comprehend what it would look like and whether I'd use class or instance methods. I eventually went with instance methods since each instance of hotel would need to have certain behaviors, like creating a list of rooms based on how many rooms are in a particular hotel.
Describe a concept that you gained more clarity on as you worked on this assignment. I gained more clarity on testing for edge cases. I also gained more clarity on everything in Ruby being an object. The Date class provided some clarity in that area, and I was surprised about how easily I was able to use it and basically treat it like any other variable or argument used in Ruby.
Describe a nominal test that you wrote for this assignment. Testing that an index in the rooms array was returning the correct room number, and making sure it returned the correct first and last elements in the array.
Describe an edge case test that you wrote for this assignment. Checking that the number of nights, based on the dates being in the correct order (so September 2, 2017 couldn't come before September 1, 2017) returned a positive number of nights and not a negative number.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? I had a hard time with pseudo code because I wanted the big picture done first. Then as I started to build the project, I found that I had to change a lot of what I had pseudo coded. I did learn during this project that it is useful to pseudo code smaller pieces that rely on other methods or elements first and then go from there. Overall, I'm finding this assignment fairly challenging. I'm not sure if that's because it's something I'm having to design myself.

@CheezItMan
Copy link

Hotel

What We're Looking For

Feature Feedback
Baseline
Used git regularly Not a lot of commits. The commits have good messages however.
Answer comprehension questions Check, I'm glad you got some clarity in testing and the Date class.
Design
Each class is responsible for a single piece of the program The design so far is pretty good, I like the functionality you put into Reservation. The Room class doesn't have much functionality however.
Classes are loosely coupled They are fairly loosely coupled. There is a bit too much in the Hotel class. More could be broken out there.
Wave 1
List rooms Check
Reserve a room for a given date range Yes, but you need checks to make sure to make that dates are valid.
List reservations for a given date The method is there, but it doesn't work. See my notes in your code.
Calculate reservation price Check
Invalid date range produces an error No checks here except for if the check-in and check-out are the same.
Wave 2
View available rooms for a given date range Not yet done.
Reserving a room that is not available produces an error Not yet done
Wave 3 Block 3 is incomplete
Create a block of rooms
Check if a block has rooms
Reserve a room from a block
Test coverage 94%
Additional Feedback Small note, on line 46 of hotel_spec.rb you're checking that a Reservation instance is an Array. I assume that's an error that should be checking that reservation.must_be_instance_of Reservation. You've got a good start on the project, but as you noted, it's not done. Let me know if/when you want me to look at this again.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some comments in your code.

require 'date'

module Administration
class Room

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this class is just a room #, I'm not sure what functionality it serves.

module Administration
class Reservation

RATE = 200

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of a constant!

lib/hotel.rb Outdated
end

def all_reservations
@all_reservations = []

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method seems to blank the list of reservations and then makes a new reservation, but with symbols for arguments. It doesn't make much sense.

Then it returns the list (with 1 element).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants