Class: LibTAD::DateCalculator::Weekdays

Inherits:
Object
  • Object
show all
Defined in:
lib/types/date_calculator/weekdays.rb

Overview

The spread of excluded or included weekdays.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Weekdays

Returns a new instance of Weekdays.



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/types/date_calculator/weekdays.rb', line 41

def initialize(hash)
  @type = hash.fetch('type', nil)
  @count = hash.fetch('count', nil)
  @mon = hash.fetch('mon', nil)
  @tue = hash.fetch('tue', nil)
  @wed = hash.fetch('wed', nil)
  @thu = hash.fetch('thu', nil)
  @fri = hash.fetch('fri', nil)
  @sat = hash.fetch('sat', nil)
  @sun = hash.fetch('sun', nil)
end

Instance Attribute Details

#countInteger (readonly)

How many days in total have been counted.

Returns:

  • (Integer)


11
12
13
# File 'lib/types/date_calculator/weekdays.rb', line 11

def count
  @count
end

#friInteger (readonly)

Count for Fridays.

Returns:

  • (Integer)


31
32
33
# File 'lib/types/date_calculator/weekdays.rb', line 31

def fri
  @fri
end

#monInteger (readonly)

Count for Mondays.

Returns:

  • (Integer)


15
16
17
# File 'lib/types/date_calculator/weekdays.rb', line 15

def mon
  @mon
end

#satInteger (readonly)

Count for Saturdays.

Returns:

  • (Integer)


35
36
37
# File 'lib/types/date_calculator/weekdays.rb', line 35

def sat
  @sat
end

#sunInteger (readonly)

Count for Sundays.

Returns:

  • (Integer)


39
40
41
# File 'lib/types/date_calculator/weekdays.rb', line 39

def sun
  @sun
end

#thuInteger (readonly)

Count for Thursdays.

Returns:

  • (Integer)


27
28
29
# File 'lib/types/date_calculator/weekdays.rb', line 27

def thu
  @thu
end

#tueInteger (readonly)

Count for Tuesdays.

Returns:

  • (Integer)


19
20
21
# File 'lib/types/date_calculator/weekdays.rb', line 19

def tue
  @tue
end

#typeString (readonly)

Specifies whether or not the weekdays counted were part of an included or excluded filter.

Returns:

  • (String)


7
8
9
# File 'lib/types/date_calculator/weekdays.rb', line 7

def type
  @type
end

#wedInteger (readonly)

Count for Wednesdays.

Returns:

  • (Integer)


23
24
25
# File 'lib/types/date_calculator/weekdays.rb', line 23

def wed
  @wed
end