Class: Holiday
- Inherits:
-
Object
- Object
- Holiday
- Defined in:
- lib/holiday.rb
Constant Summary collapse
- CALENDARS_FILENAME =
File.( "#{File.dirname(__FILE__)}/../data/calendars.json" )
Instance Attribute Summary collapse
-
#calendars ⇒ Object
readonly
Returns the value of attribute calendars.
Instance Method Summary collapse
- #in(year) ⇒ Object
-
#initialize(calendars) ⇒ Holiday
constructor
A new instance of Holiday.
- #load_data ⇒ Object
Constructor Details
#initialize(calendars) ⇒ Holiday
Returns a new instance of Holiday.
13 14 15 |
# File 'lib/holiday.rb', line 13 def initialize(calendars) @calendars = calendars end |
Instance Attribute Details
#calendars ⇒ Object (readonly)
Returns the value of attribute calendars.
7 8 9 |
# File 'lib/holiday.rb', line 7 def calendars @calendars end |
Instance Method Details
#in(year) ⇒ Object
17 18 19 |
# File 'lib/holiday.rb', line 17 def in(year) holidays[year] end |
#load_data ⇒ Object
21 22 23 24 25 |
# File 'lib/holiday.rb', line 21 def load_data # TODO: remove this in a major version holidays calendars end |