Class: Week
- Inherits:
-
Object
- Object
- Week
- Includes:
- Comparable, DateRange
- Defined in:
- lib/funtimes/week.rb
Constant Summary collapse
- START_DAY =
0
Instance Attribute Summary collapse
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(date) ⇒ Week
constructor
A new instance of Week.
- #prev ⇒ Object
- #succ ⇒ Object
Methods included from DateRange
#&, #days, #encompasses, #intersects, #months, #number_of_days_in, #quarters, #same_range_as, #weeks, #|
Constructor Details
#initialize(date) ⇒ Week
Returns a new instance of Week.
11 12 13 14 |
# File 'lib/funtimes/week.rb', line 11 def initialize(date) start_date = get_start_date(date) @start_date, @end_date = start_date, start_date + 6 end |
Instance Attribute Details
#end_date ⇒ Object
Returns the value of attribute end_date.
5 6 7 |
# File 'lib/funtimes/week.rb', line 5 def end_date @end_date end |
#start_date ⇒ Object
Returns the value of attribute start_date.
5 6 7 |
# File 'lib/funtimes/week.rb', line 5 def start_date @start_date end |