jeremygpeterson/BusinessHours
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Business Hours is a Ruby script which will determine the guaranteed time given a business hour schedule. Implements Business Hours, update, closed, closed?, and each iterator for Business Hours. As defined in the RPCFN: Business Hours (#10) challenge: http://rubylearning.com/blog/2010/05/25/rpcfn-business-hours-10/ Updated from feedback and verified that Day Light Saving time is handled correctly. Create Business Hour object hours = BusinessHours.new("9:00 AM", "3:00 PM") Updating Hours: Week Days are updated using Symbol and start/close hours as strings. hours.update :fri, "10:00 AM", "5:00 PM" hours.update :sat, "9:00 AM", "9:30 PM" Specific Days are updated using a Time or String Object and start/close hours as strings. hours.update "Dec 24, 2010", "8:00 AM", "1:00 PM" hours.update(Time.parse("6/11/2010"), "9:00", "10:00") Closed Hours: Method specifying days closed, where symbols (week days) and Time or String Objects define specific days. hours.closed :sun, :wed, "Dec 25, 2010"
About
RPCFN Business Hours #10 Challenge
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published