Class: LibTAD::DateCalculator::Weekdays
- Inherits:
-
Object
- Object
- LibTAD::DateCalculator::Weekdays
- Defined in:
- lib/types/date_calculator/weekdays.rb
Overview
The spread of excluded or included weekdays.
Instance Attribute Summary collapse
-
#count ⇒ Integer
readonly
How many days in total have been counted.
-
#fri ⇒ Integer
readonly
Count for Fridays.
-
#mon ⇒ Integer
readonly
Count for Mondays.
-
#sat ⇒ Integer
readonly
Count for Saturdays.
-
#sun ⇒ Integer
readonly
Count for Sundays.
-
#thu ⇒ Integer
readonly
Count for Thursdays.
-
#tue ⇒ Integer
readonly
Count for Tuesdays.
-
#type ⇒ String
readonly
Specifies whether or not the weekdays counted were part of an included or excluded filter.
-
#wed ⇒ Integer
readonly
Count for Wednesdays.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Weekdays
constructor
A new instance of Weekdays.
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
#count ⇒ Integer (readonly)
How many days in total have been counted.
11 12 13 |
# File 'lib/types/date_calculator/weekdays.rb', line 11 def count @count end |
#fri ⇒ Integer (readonly)
Count for Fridays.
31 32 33 |
# File 'lib/types/date_calculator/weekdays.rb', line 31 def fri @fri end |
#mon ⇒ Integer (readonly)
Count for Mondays.
15 16 17 |
# File 'lib/types/date_calculator/weekdays.rb', line 15 def mon @mon end |
#sat ⇒ Integer (readonly)
Count for Saturdays.
35 36 37 |
# File 'lib/types/date_calculator/weekdays.rb', line 35 def sat @sat end |
#sun ⇒ Integer (readonly)
Count for Sundays.
39 40 41 |
# File 'lib/types/date_calculator/weekdays.rb', line 39 def sun @sun end |
#thu ⇒ Integer (readonly)
Count for Thursdays.
27 28 29 |
# File 'lib/types/date_calculator/weekdays.rb', line 27 def thu @thu end |
#tue ⇒ Integer (readonly)
Count for Tuesdays.
19 20 21 |
# File 'lib/types/date_calculator/weekdays.rb', line 19 def tue @tue end |
#type ⇒ String (readonly)
Specifies whether or not the weekdays counted were part of an included or excluded filter.
7 8 9 |
# File 'lib/types/date_calculator/weekdays.rb', line 7 def type @type end |
#wed ⇒ Integer (readonly)
Count for Wednesdays.
23 24 25 |
# File 'lib/types/date_calculator/weekdays.rb', line 23 def wed @wed end |