-
Notifications
You must be signed in to change notification settings - Fork 45
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
Stef -- Carets #49
base: master
Are you sure you want to change the base?
Stef -- Carets #49
Conversation
… about previous definition line 21, unsure...
…still there for reservations, frustrating.
HotelWhat We're Looking For
|
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.
Just some notes in the code.
# This also needs to (I believe) hold the room cost. Each room has a $200 charge per night. | ||
|
||
module HotelHedwig | ||
class 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 would probably name this class Room
instead of Rooms
. Since it describes a single room.
|
||
# Using a self.all method to work out the room numbering system. | ||
|
||
def self.all |
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.
A good start on this, but you'd need to initialize number (probably to 0) and having return rooms
at the end of the method.
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.
It is a good idea, down the road to have a .all
method like this, but also notice that this method generates an all new list each time.
def initialize(check_in, check_out) | ||
@check_in = check_in | ||
@check_out = check_out | ||
|
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.
It looks like this initialize
method isn't closed with an end
properly.
require_relative 'reservations' | ||
|
||
module HotelHedwig | ||
class Reservations |
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.
You're redoing this class again?
|
||
# Why is invalid_date raising a warning??? | ||
|
||
def invalid_date |
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 method to have, just need to use it!
|
||
describe "invalid_date" do | ||
it "Must raise argument error if check-in date is after check out date" do | ||
proc { HotelHedwig::Reservations.new(@check_in < @check_out) }.must_raise ArgumentError |
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.
You're passing initialize
a boolean (true/false) instead of two dates.
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.
Really good work going through the prompts and questions here.
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.
The only other thing is there is no revision of Hotel as was in the assignment.
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.
In code comments.
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions
| Describe a concept that you gained more clarity on as you worked on this assignment. | I’m getting better with classes. I did several hours of treehouse after I came up with my design ideas to re-solidify the syntax since I still have problems remembering things, understanding them is fine, but utilizing them (you guys know, you’ve been helping me)… Anyways, actually doing that helped me feel more comfortable on how I was going about things. However, I want to add that I REALLY need to be more comfortable with testing. I feel like I do not do enough tests, as I play it safe and I still get stuck and frustrated because the idea of testing first and coding last doesn't seem to work very well in my mind, at least not for me and perhaps that is due to where I am at. |
|Describe a nominal test that you wrote for this assignment. | I'd say accessing the cost of the room. |
| Describe an edge case test that you wrote for this assignment. | By tonight hopefully checking on accessing the data by date range will be it. That is the goal. |
| How do you feel you did in writing pseudocode first, then writing the tests and then the code? | I have a love/hate with pseudocode. Initially I loved it, because I like that it kind of helps me come up with ideas and work through them and see if I need other things or if I’ve repeated myself. My one issue with it is that I confused the bejesus out of myself a couple times going back and forth so I had to stop being overly detailed. I tried to be really basic and literal this time, not sure what counts as pseudocode. I think that with time this will all get easier. A part of me thinks this is just extra work though I see how things could be better/easier by doing this too. |
Please note I did not get to finish last night, will be doing that tonight and re-submitting.