Class: LibTAD::DateCalculator::BusinessHoliday
- Inherits:
-
Object
- Object
- LibTAD::DateCalculator::BusinessHoliday
- Defined in:
- lib/types/date_calculator/business_holiday.rb
Overview
A holiday event which occurs in a requested period.
Instance Attribute Summary collapse
-
#count ⇒ Integer
readonly
The number of holidays in the results.
-
#list ⇒ Array<::LibTAD::Holiday::Holiday>
readonly
Holidays which occur in the requested period.
-
#type ⇒ String
readonly
Either included or excluded, specifying whether or not the holidays in the result array were included or excluded when queried.
Instance Method Summary collapse
-
#initialize(hash) ⇒ BusinessHoliday
constructor
A new instance of BusinessHoliday.
Constructor Details
#initialize(hash) ⇒ BusinessHoliday
Returns a new instance of BusinessHoliday.
18 19 20 21 22 23 |
# File 'lib/types/date_calculator/business_holiday.rb', line 18 def initialize(hash) @type = hash.fetch('type', nil) @count = hash.fetch('count', nil) @list = hash.fetch('list', nil) &.map { |e| ::LibTAD::Holidays::Holiday.new(e) } end |
Instance Attribute Details
#count ⇒ Integer (readonly)
The number of holidays in the results.
12 13 14 |
# File 'lib/types/date_calculator/business_holiday.rb', line 12 def count @count end |
#list ⇒ Array<::LibTAD::Holiday::Holiday> (readonly)
Holidays which occur in the requested period.
16 17 18 |
# File 'lib/types/date_calculator/business_holiday.rb', line 16 def list @list end |
#type ⇒ String (readonly)
Either included or excluded, specifying whether or not the holidays in the result array were included or excluded when queried.
8 9 10 |
# File 'lib/types/date_calculator/business_holiday.rb', line 8 def type @type end |