Class: LibTAD::Holidays::HolidayState
- Inherits:
-
Object
- Object
- LibTAD::Holidays::HolidayState
- Defined in:
- lib/types/holidays/holiday_state.rb
Overview
A holiday event in a specific state.
Instance Attribute Summary collapse
-
#abbrev ⇒ String
readonly
Abbreviation of the state/subdivision.
-
#exception ⇒ String
readonly
Eventual exception if the holiday does not affect the whole state/subdivision.
-
#id ⇒ Integer
readonly
Unique id of the state/subdivision.
-
#iso ⇒ String
readonly
An ISO 3166-1 country or ISO 3166-2 country state code.
-
#name ⇒ String
readonly
Common name of the state/subdivision.
Instance Method Summary collapse
-
#initialize(hash) ⇒ HolidayState
constructor
A new instance of HolidayState.
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
#abbrev ⇒ String (readonly)
Abbreviation of the state/subdivision.
16 17 18 |
# File 'lib/types/holidays/holiday_state.rb', line 16 def abbrev @abbrev end |
#exception ⇒ String (readonly)
Eventual exception if the holiday does not affect the whole state/subdivision.
24 25 26 |
# File 'lib/types/holidays/holiday_state.rb', line 24 def exception @exception end |
#id ⇒ Integer (readonly)
Unique id of the state/subdivision.
12 13 14 |
# File 'lib/types/holidays/holiday_state.rb', line 12 def id @id end |
#iso ⇒ String (readonly)
An ISO 3166-1 country or ISO 3166-2 country state code.
8 9 10 |
# File 'lib/types/holidays/holiday_state.rb', line 8 def iso @iso end |
#name ⇒ String (readonly)
Common name of the state/subdivision.
20 21 22 |
# File 'lib/types/holidays/holiday_state.rb', line 20 def name @name end |