Skip to content

This little gem is a simple application to manage a hotel by checking in/checking out guests.

License

Notifications You must be signed in to change notification settings

Macavirus/hotel-management-dry-rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Stale Peaches
May 16, 2019
f232704 · May 16, 2019

History

14 Commits
May 5, 2019
May 16, 2019
May 16, 2019
May 5, 2019
May 5, 2019
May 5, 2019
May 5, 2019
May 8, 2019
May 8, 2019
May 5, 2019
May 16, 2019
May 5, 2019
May 5, 2019

Repository files navigation

Hotel Management

This little gem is a simple application to manage a hotel by checking in/checking out guests.

Purpose

This application is mainly used as an experiment to test out the dry-monads and dry-validation libraries from https://dry-rb.org/. They allow for easier control flow through a variety of clean, functional steps that can each produce an error. Inspired by railway-oriented-programming from the F# community.

Example usage:

hotel = Hotel.new
room_manager = RoomManager.new

# create a guest and try to check them in
guest = { name: "Jan Hrach", rooms: [18, 19, 20]}

# check in a guest
# check_in_result is either a Success or Failure monad
check_in_result = CheckInGuest.new(room_manager: room_manager).call(guest)

# check out the guest
# result is either a Success or Failure monad
check_out_result = CheckOutGuest.new(room_manager: room_manager).call(guest)

License

The gem is available as open source under the terms of the MIT License.

About

This little gem is a simple application to manage a hotel by checking in/checking out guests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published