Class: RussianWorkdays::Year

Inherits:
CollectionPreset show all
Defined in:
lib/russian_workdays/year.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(year = Date.today.year) ⇒ Year

Returns a new instance of Year.

Raises:



10
11
12
13
14
# File 'lib/russian_workdays/year.rb', line 10

def initialize(year = Date.today.year)
  raise MissingYearError, year unless DATES.key?(year)

  @year = year
end

Instance Attribute Details

#yearObject (readonly)

Returns the value of attribute year.



8
9
10
# File 'lib/russian_workdays/year.rb', line 8

def year
  @year
end