Class: LibTAD::DateCalculator::BusinessHoliday

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

Overview

A holiday event which occurs in a requested period.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#countInteger (readonly)

The number of holidays in the results.

Returns:

  • (Integer)


12
13
14
# File 'lib/types/date_calculator/business_holiday.rb', line 12

def count
  @count
end

#listArray<::LibTAD::Holiday::Holiday> (readonly)

Holidays which occur in the requested period.

Returns:

  • (Array<::LibTAD::Holiday::Holiday>)


16
17
18
# File 'lib/types/date_calculator/business_holiday.rb', line 16

def list
  @list
end

#typeString (readonly)

Either included or excluded, specifying whether or not the holidays in the result array were included or excluded when queried.

Returns:

  • (String)


8
9
10
# File 'lib/types/date_calculator/business_holiday.rb', line 8

def type
  @type
end