Class: RussianWorkdays::Month
- Inherits:
-
CollectionPreset
- Object
- CollectionPreset
- RussianWorkdays::Month
- Defined in:
- lib/russian_workdays/month.rb
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.
7 8 9 10 |
# File 'lib/russian_workdays/month.rb', line 7 def initialize(year = Date.today.year, month = 1) raise ArgumentError, "Must be a number between 1 and 12" unless (1..12).include?(month) @dates = Collection.new(Date.new(year, month, 1)..Date.new(year, month, -1)) end |