Class: HolidayJp::Holidays
- Inherits:
-
Object
- Object
- HolidayJp::Holidays
- Defined in:
- lib/holiday_jp/holidays.rb
Instance Attribute Summary collapse
-
#holidays ⇒ Object
Returns the value of attribute holidays.
Instance Method Summary collapse
- #between(start, last) ⇒ Object
- #holiday?(date) ⇒ Boolean
-
#initialize ⇒ Holidays
constructor
A new instance of Holidays.
Constructor Details
Instance Attribute Details
#holidays ⇒ Object
Returns the value of attribute holidays.
5 6 7 |
# File 'lib/holiday_jp/holidays.rb', line 5 def holidays @holidays end |
Instance Method Details
#between(start, last) ⇒ Object
15 16 17 18 19 |
# File 'lib/holiday_jp/holidays.rb', line 15 def between(start, last) holidays.find_all do |date, _holiday| start <= date && date <= last end.map(&:last) end |
#holiday?(date) ⇒ Boolean
21 22 23 |
# File 'lib/holiday_jp/holidays.rb', line 21 def holiday?(date) holidays[date] end |