Class: Date
Direct Known Subclasses
Constant Summary
Constants included from ShiftyWeek
Instance Attribute Summary collapse
-
#week_day_start ⇒ Object
writeonly
Sets the attribute week_day_start.
Instance Method Summary collapse
-
#step(limit, step = 1) ⇒ Object
Seemed to make more sense to me to have step accept an integer number see step_to_date for previous behavior.
-
#step_to_date ⇒ Object
:nodoc:.
Methods included from ShiftyWeek
#days_in_month, included, #last_week_day, #month_name, #month_names, #step_to_month_end, #wday_offset, #week, #week_day_start, #week_days, #weeks_in_year
Instance Attribute Details
#week_day_start=(value) ⇒ Object (writeonly)
Sets the attribute week_day_start
3 4 5 |
# File 'lib/shifty_week/date.rb', line 3 def week_day_start=(value) @week_day_start = value end |
Instance Method Details
#step(limit, step = 1) ⇒ Object
Seemed to make more sense to me to have step accept an integer number
see step_to_date for previous behavior. Although, you can still pass
a datetime object to this method and it will call the previous behavior.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/shifty_week/date.rb', line 9 def step(limit, step=1) method = 'step_to_date' if limit.is_a?(Integer) limit = (self + limit)-1 method = 'step' end send(method, limit, step) {|a_day| a_day.week_day_start = self.week_day_start yield a_day } end |
#step_to_date ⇒ Object
:nodoc:
5 |
# File 'lib/shifty_week/date.rb', line 5 alias_method :step_to_date, :step |