Project

shiftly

0.0
No commit activity in last 3 years
No release in over 3 years
Factory shift methods collection
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Shiftly

Gem Version Build Status Code Climate

Factory shift methods collection by RubyLogic, PL

Usage

Add it to your Gemfile with:

gem 'shiftly'

Run the bundle command to install it.

Run generator if needed with:

rails generate shiftly:config

Then you have access to the following extensions.

Time class exts

Time.now.to_factory_date
# returns yesterday when it is before 6am and today otherwise

Time.now.shift
# returns shift number for datetime

Time.now.shift_beg
# returns shift beginning datetime

Time.now.shift_end
# returns shift end datetime

Fixnum class exts

1.next_shift
# returns next shift for 1, 2 or 3

1.prev_shift
# returns previous shift for 1, 2 or 3

License

Copyright © 2012 - 2014 Ruby Logic, released under the MIT license