Class: RubyCalendar::Calendar
- Inherits:
-
Object
- Object
- RubyCalendar::Calendar
- Defined in:
- lib/ruby_calendar/calendar.rb
Constant Summary collapse
- WEEK_DAY_NAME =
%w[Sunday Monday Tuesday Wednesday Thursday Friday Saturday].freeze
Constants included from Year
Instance Attribute Summary collapse
-
#firstweekday ⇒ Object
Returns the value of attribute firstweekday.
Instance Method Summary collapse
-
#initialize(year = today_year, month = today_month, firstweekday: 0) ⇒ Calendar
constructor
A new instance of Calendar.
- #set_firstweekday(firstweekday) ⇒ Object
- #set_month(month) ⇒ Object
- #set_year(year) ⇒ Object
Methods included from Year
Methods included from Month
Constructor Details
#initialize(year = today_year, month = today_month, firstweekday: 0) ⇒ Calendar
Returns a new instance of Calendar.
15 16 17 18 19 |
# File 'lib/ruby_calendar/calendar.rb', line 15 def initialize(year = today_year, month = today_month, firstweekday: 0) @year = year @month = month @firstweekday = firstweekday end |
Instance Attribute Details
#firstweekday ⇒ Object
Returns the value of attribute firstweekday.
11 12 13 |
# File 'lib/ruby_calendar/calendar.rb', line 11 def firstweekday @firstweekday end |
Instance Method Details
#set_firstweekday(firstweekday) ⇒ Object
31 32 33 34 |
# File 'lib/ruby_calendar/calendar.rb', line 31 def set_firstweekday(firstweekday) @firstweekday = firstweekday self end |
#set_month(month) ⇒ Object
26 27 28 29 |
# File 'lib/ruby_calendar/calendar.rb', line 26 def set_month(month) @month = month self end |
#set_year(year) ⇒ Object
21 22 23 24 |
# File 'lib/ruby_calendar/calendar.rb', line 21 def set_year(year) @year = year self end |