Class: Calagator::TimeRangeHelper::TimeRange
- Inherits:
-
Struct
- Object
- Struct
- Calagator::TimeRangeHelper::TimeRange
- Defined in:
- app/helpers/calagator/time_range_helper.rb
Instance Attribute Summary collapse
-
#context_date ⇒ Object
Returns the value of attribute context_date.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#format ⇒ Object
Returns the value of attribute format.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Instance Method Summary collapse
-
#to_s ⇒ Object
A representation of a time or range of time that can format itself in a meaningful way.
Instance Attribute Details
#context_date ⇒ Object
Returns the value of attribute context_date
19 20 21 |
# File 'app/helpers/calagator/time_range_helper.rb', line 19 def context_date @context_date end |
#end_time ⇒ Object
Returns the value of attribute end_time
19 20 21 |
# File 'app/helpers/calagator/time_range_helper.rb', line 19 def end_time @end_time end |
#format ⇒ Object
Returns the value of attribute format
19 20 21 |
# File 'app/helpers/calagator/time_range_helper.rb', line 19 def format @format end |
#start_time ⇒ Object
Returns the value of attribute start_time
19 20 21 |
# File 'app/helpers/calagator/time_range_helper.rb', line 19 def start_time @start_time end |
Instance Method Details
#to_s ⇒ Object
A representation of a time or range of time that can format itself in a meaningful way. Examples: “Thursday, April 3, 2008” “Thursday, April 3, 2008 at 4pm” “Thursday, April 3, 2008 from 4:30-6pm” (context: in the list for today) “11:30am-2pm” “Thursday-Friday, April 3-5, 2008” (context: during 2008) “Thursday April 5, 2009 at 3:30pm through Friday, April 5 at 8:45pm, 2009” (same, context: during 2009) “Thursday April 5 at 3:30pm through Friday, April 5 at 8:45pm”
29 30 31 |
# File 'app/helpers/calagator/time_range_helper.rb', line 29 def to_s [start_text, conjunction, end_text].compact.join end |