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

Pipes - Nkiru - Hotel #42

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d0e1d07
Added a Rakefile
nkiruka Sep 6, 2017
65c8d1a
Created file new file
nkiruka Sep 6, 2017
cb76466
Created new file for hotel class
nkiruka Sep 6, 2017
9cb7c61
Create new file for reservation class
nkiruka Sep 6, 2017
79f37d4
Created spec helper file
nkiruka Sep 6, 2017
30be2cd
Created new test file for date_range class
nkiruka Sep 6, 2017
c515095
Created test file for reservation class
nkiruka Sep 6, 2017
8b2cf49
Added a module
nkiruka Sep 6, 2017
74db4bb
Created test for initialize method
nkiruka Sep 6, 2017
2b103c7
Created test for initialize method
nkiruka Sep 6, 2017
3115b7c
Added date_range file
nkiruka Sep 6, 2017
131a909
Created date_include method
nkiruka Sep 6, 2017
91a6c29
Added test for date_include method
nkiruka Sep 6, 2017
2947707
Added test for invalid date entry
nkiruka Sep 6, 2017
329fe9b
Refactored tests
nkiruka Sep 6, 2017
0d89d32
Created overlap method
nkiruka Sep 6, 2017
dbaf7ec
Tested date overlap method
nkiruka Sep 6, 2017
28d0ad4
Added 4 additional tests for overlap method
nkiruka Sep 6, 2017
673c52f
Modified the overlap method
nkiruka Sep 6, 2017
a66fab8
Added room and booking_system to spec file
nkiruka Sep 7, 2017
b0adc07
Created initialize method
nkiruka Sep 7, 2017
53455cc
Created initialize and self methods
nkiruka Sep 8, 2017
4cff4f1
Added tests for initialize and self methods
nkiruka Sep 8, 2017
8c999db
Added another test for the all method
nkiruka Sep 8, 2017
9ab879a
Added another test for the all method
nkiruka Sep 8, 2017
b56f895
Added total cost method
nkiruka Sep 8, 2017
eadd6a8
Added initialize and total cost tests
nkiruka Sep 8, 2017
cde4005
created room class
nkiruka Sep 11, 2017
6add0b1
Added test for initialize method
nkiruka Sep 11, 2017
5d95ca1
Added additional tests for initialize method
nkiruka Sep 11, 2017
20617e1
removed unnecessary code
nkiruka Sep 11, 2017
399047b
Added tests for initialize and total cost methods
nkiruka Sep 11, 2017
b37015d
Edited initialize method
nkiruka Sep 11, 2017
87a1a93
Modified all tests
nkiruka Sep 11, 2017
3a2f997
Added new variable to include and overlap methods
nkiruka Sep 11, 2017
27f9dd5
Corrected date_range in include method
nkiruka Sep 11, 2017
f31d007
Added edge case testing for include method
nkiruka Sep 11, 2017
ca75b74
Fixed indentation
nkiruka Sep 11, 2017
3b33547
Fixed indentation
nkiruka Sep 11, 2017
480123a
Added initialize method
nkiruka Sep 11, 2017
fba8b6e
Added test for initialize method
nkiruka Sep 11, 2017
c7837c0
Added additional tests for initialize method
nkiruka Sep 11, 2017
1f6bf91
Removed duplicate code
nkiruka Sep 11, 2017
ac710dc
Edited total_cost method
nkiruka Sep 11, 2017
a505e08
Edited tests
nkiruka Sep 11, 2017
8c75ea9
Added another test to total cost
nkiruka Sep 11, 2017
23f7d89
Edited file
nkiruka Sep 11, 2017
eb78ee2
Added test for room available method
nkiruka Sep 11, 2017
137fe73
Edited room available method to check the correct index
nkiruka Sep 12, 2017
6d339d3
test on room availability passed
nkiruka Sep 12, 2017
7004075
Edited files
nkiruka Sep 12, 2017
81b1408
Update booking_system.rb
nkiruka Sep 12, 2017
bc0f84c
Completed design activity
nkiruka Oct 2, 2017
d878eaf
Update design activity
nkiruka Oct 2, 2017
a407a32
changed the argument name in the overlap method for reservation class
nkiruka Oct 2, 2017
09eaff3
removed comments
nkiruka Oct 2, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added total cost method
nkiruka committed Sep 8, 2017
commit b56f89562e64b4226a04e3b7d23c8b96b9833ce5
18 changes: 18 additions & 0 deletions lib/reservation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module Hotel
class Reservation
attr_reader :dates

ROOMCOST = 200

def initialize(checkin_date, checkout_date)
@dates = DateRange.new(checkin_date, checkout_date)
@num_nights = checkout_date - checkin_date
end

def price_night
total_cost = (@num_nights-1) * ROOMCOST
return total_cost
end
end

end