Class: DateTime

Inherits:
Object
  • Object
show all
Defined in:
lib/russian_holidays_checkup/extended.rb

Instance Method Summary collapse

Instance Method Details

#russian_holiday?Boolean

Returns:

  • (Boolean)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/russian_holidays_checkup/extended.rb', line 2

def russian_holiday?
  all_russian_holidays = [
      Date.new(2015, 1, 1),
      Date.new(2015, 1, 2),
      Date.new(2015, 1, 5),
      Date.new(2015, 1, 6),
      Date.new(2015, 1, 7),
      Date.new(2015, 1, 8),
      Date.new(2015, 1, 9),
      Date.new(2015, 2, 23),
      Date.new(2015, 3, 9),
      Date.new(2015, 5, 1),
      Date.new(2015, 5, 4),
      Date.new(2015, 5, 11),
      Date.new(2015, 6, 12),
      Date.new(2015, 11, 4)
  ]
  if all_russian_holidays.index(self.to_date).nil?
    false
  else
    true
  end
end