Class: Denso::Calendar::Date
- Inherits:
-
Date
- Object
- Date
- Denso::Calendar::Date
- Defined in:
- lib/denso/calendar/date.rb
Instance Method Summary collapse
-
#business_day? ⇒ Boolean
Returns true if the day is business day, meaning not holiday.
-
#holiday? ⇒ Boolean
Returns true if the day is holiday.
-
#initialize(*args) ⇒ Date
constructor
A new instance of Date.
Constructor Details
#initialize(*args) ⇒ Date
Returns a new instance of Date.
8 9 10 11 12 13 |
# File 'lib/denso/calendar/date.rb', line 8 def initialize(*args) = args.last.is_a?(Hash) ? args.pop : { holiday: true } super(*args) @holiday = [:holiday] end |
Instance Method Details
#business_day? ⇒ Boolean
Returns true if the day is business day, meaning not holiday
27 28 29 |
# File 'lib/denso/calendar/date.rb', line 27 def business_day? !holiday? end |
#holiday? ⇒ Boolean
Returns true if the day is holiday
19 20 21 |
# File 'lib/denso/calendar/date.rb', line 19 def holiday? @holiday end |