Class: Date

Inherits:
Object
  • Object
show all
Defined in:
lib/extensions/date.rb

Overview

Add workday and weekday concepts to the Date class

Instance Method Summary collapse

Instance Method Details

#weekday?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/extensions/date.rb', line 7

def weekday?
  [1,2,3,4,5].include? self.wday
end

#workday?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/extensions/date.rb', line 3

def workday?
  self.weekday? && !BusinessTime::Config.holidays.include?(self)
end