Project

prekin

0.0
There's a lot of open issues
No release in over a year
Return true or false when you specify the day of month (by Time class, Date class, DateTime class or String class). The criteria is whether the day is 'PREMIUM FRIDAY' or not. 'PREMIUM FRIDAY' is the last friday in month in Japan.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Prekin

Prekin

What is Prekin?

Naming

  • Prekin means PREMIUM FRIDAY
    • kin means FRIDAY (kin-yo-bi) in Japanese
    • So PREmium KIN-yo-bi is Prekin

Webpage

Installation

Add this line to your application's Gemfile:

gem 'prekin'

And then execute:

$ bundle

Or install it yourself as:

$ gem install prekin

Usage

1. require

  • require 'prekin'

2. call

2-1. Time class

  • Time.local(2020, 10, 30, 0, 0, 0).prekin? #=> true

2-2. Date class

  • Date.new(2020, 10, 30).prekin? #=> true

2-3. DateTime class

  • DateTime.new(2020, 10, 30, 0, 0, 0, '+09:00').prekin? #=> true

2-4. String class

  • '2020/10/30 00:00:00 +09:00'.prekin? #=> true

2-5. Next Prekin

  • Prekin.next #=> "2020-10-30"
  • Prekin.next('2023-12-28') #=> "2023-12-29"
  • Prekin.next('2023-12-29') #=> "2023-12-29"
  • Prekin.next('2023-12-30') #=> "2024-01-26"

Note

  • This gem overwrites Time, Date, DateTime and String class.
    • So if you use Time, Date, DateTime and String class in your code, you should be careful.

Development

1. bundle install

  • bundle install

2. irb

  • bundle exec irb

3. require

  • require 'prekin'

License

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