Class: RussianWorkdays::Month
- Inherits:
-
CollectionPreset
- Object
- CollectionPreset
- RussianWorkdays::Month
- Defined in:
- lib/russian_workdays/month.rb
Instance Attribute Summary collapse
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(year = Date.today.year, month = 1) ⇒ Month
constructor
A new instance of Month.
Constructor Details
#initialize(year = Date.today.year, month = 1) ⇒ Month
Returns a new instance of Month.
10 11 12 13 14 15 16 |
# File 'lib/russian_workdays/month.rb', line 10 def initialize(year = Date.today.year, month = 1) raise MissingYearError, year unless DATES.key?(year) raise ArgumentError, 'Must be a number between 1 and 12' unless (1..12).include?(month) @year = year @month = month end |
Instance Attribute Details
#month ⇒ Object (readonly)
Returns the value of attribute month.
8 9 10 |
# File 'lib/russian_workdays/month.rb', line 8 def month @month end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
8 9 10 |
# File 'lib/russian_workdays/month.rb', line 8 def year @year end |