Class: LibTAD::Holidays::HolidayState

Inherits:
Object
  • Object
show all
Defined in:
lib/types/holidays/holiday_state.rb

Overview

A holiday event in a specific state.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ HolidayState

Returns a new instance of HolidayState.



26
27
28
29
30
31
32
# File 'lib/types/holidays/holiday_state.rb', line 26

def initialize(hash)
  @iso = hash.fetch('iso', nil)
  @id = hash.fetch('id', nil)
  @abbrev = hash.fetch('abbrev', nil)
  @name = hash.fetch('name', nil)
  @exception = hash.fetch('exception', nil)
end

Instance Attribute Details

#abbrevString (readonly)

Abbreviation of the state/subdivision.

Returns:

  • (String)


16
17
18
# File 'lib/types/holidays/holiday_state.rb', line 16

def abbrev
  @abbrev
end

#exceptionString (readonly)

Eventual exception if the holiday does not affect the whole state/subdivision.

Returns:

  • (String)


24
25
26
# File 'lib/types/holidays/holiday_state.rb', line 24

def exception
  @exception
end

#idInteger (readonly)

Unique id of the state/subdivision.

Returns:

  • (Integer)


12
13
14
# File 'lib/types/holidays/holiday_state.rb', line 12

def id
  @id
end

#isoString (readonly)

An ISO 3166-1 country or ISO 3166-2 country state code.

Returns:

  • (String)

See Also:



8
9
10
# File 'lib/types/holidays/holiday_state.rb', line 8

def iso
  @iso
end

#nameString (readonly)

Common name of the state/subdivision.

Returns:

  • (String)


20
21
22
# File 'lib/types/holidays/holiday_state.rb', line 20

def name
  @name
end