loading...
Cover image for taco_tuesday gem, now with more tacos

taco_tuesday gem, now with more tacos

drbragg profile image Drew Bragg ・1 min read

taco_tuesday gem (2 Part Series)

1) The taco_tuesday gem, cause Tacos 2) 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?

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?

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

taco_tuesday gem (2 Part Series)

1) The taco_tuesday gem, cause Tacos 2) taco_tuesday gem, now with more tacos

Posted on Jun 2 by:

drbragg profile

Drew Bragg

@drbragg

Full Stack Dev | Single Dad | Board Game Geek | Rucker

Discussion

markdown guide