Class: Calagator::TimeRangeHelper::TimeRange

Inherits:
Struct
  • Object
show all
Defined in:
app/helpers/calagator/time_range_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#context_dateObject

Returns the value of attribute context_date

Returns:

  • (Object)

    the current value of context_date



16
17
18
# File 'app/helpers/calagator/time_range_helper.rb', line 16

def context_date
  @context_date
end

#end_timeObject

Returns the value of attribute end_time

Returns:

  • (Object)

    the current value of end_time



16
17
18
# File 'app/helpers/calagator/time_range_helper.rb', line 16

def end_time
  @end_time
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



16
17
18
# File 'app/helpers/calagator/time_range_helper.rb', line 16

def format
  @format
end

#start_timeObject

Returns the value of attribute start_time

Returns:

  • (Object)

    the current value of start_time



16
17
18
# File 'app/helpers/calagator/time_range_helper.rb', line 16

def start_time
  @start_time
end

Instance Method Details

#to_sObject

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”



26
27
28
# File 'app/helpers/calagator/time_range_helper.rb', line 26

def to_s
  [start_text, conjunction, end_text].compact.join
end