DEV Community

Cover image for taco_tuesday gem, now with more tacos
Drew Bragg
Drew Bragg

Posted on

taco_tuesday gem, now with more tacos

Thanks to Colin Bartlett's awesome contribution to the taco_tuesday gem version 0.2.0 has been released!

In 0.2.0 you can now run ๐ŸŒฎ? on Date and Time classes to know if it's a Taco Tuesday.

require 'taco_tuesday'

# May 26th 2020 is a Tuesday
tuesday = Date.new(2020, 5, 26)
tuesday.taco_tuesday? #=> true
tuesday.๐ŸŒฎ? #=> true

# May 25th 2020 is a Monday
monday = Date.new(2020, 5, 25)
monday.taco_tuesday? #=> false
monday.๐ŸŒฎ? #=> false

# Check if today is Taco Tuesday
Date.today.taco_tuesday? #=> Same result as Date.today.tuesday?
Date.today.๐ŸŒฎ? #=> Same result as Date.today.taco_tuesday?
Enter fullscreen mode Exit fullscreen mode

Or with the Time class:

require 'taco_tuesday'

# May 26th 2020 is a Tuesday
tuesday = Time.new(2020, 5, 26)
tuesday.taco_tuesday? #=> true
tuesday.๐ŸŒฎ? #=> true

# May 25th 2020 is a Monday
monday = Time.new(2020, 5, 25)
monday.taco_tuesday? #=> false
monday.๐ŸŒฎ? #=> false

# Check if today is Taco Tuesday
Time.now.taco_tuesday? #=> Same result as Time.now.tuesday?
Time.now.๐ŸŒฎ? #=> Same result as Time.now.taco_tuesday?
Enter fullscreen mode Exit fullscreen mode

With the power of both taco_tuesday? AND ๐ŸŒฎ? you and your ruby apps are sure to never miss another Taco Tuesday!

Top comments (0)