Class: Denso::Calendar::Date

Inherits:
Date
  • Object
show all
Defined in:
lib/denso/calendar/date.rb

Instance Method Summary collapse

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)
  options = args.last.is_a?(Hash) ? args.pop : { holiday: true }
  super(*args)

  @holiday = options[:holiday]
end

Instance Method Details

#business_day?Boolean

Returns true if the day is business day, meaning not holiday

Returns:

  • (Boolean)

See Also:



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

Returns:

  • (Boolean)

See Also:



19
20
21
# File 'lib/denso/calendar/date.rb', line 19

def holiday?
  @holiday
end