Class: Calagator::TimeRangeHelper::TimePartRenderer

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

Constant Summary collapse

PREFIXES =
{
  :hour => " ",
  [nil, :hour] => "",
  :year => ", ",
  :end_hour => " ",
  :end_year => ", ",
  :at => " ",
}
SUFFIXES =
{
  :month => " ",
  :wday => ", ",
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



125
126
127
# File 'app/helpers/calagator/time_range_helper.rb', line 125

def format
  @format
end

#partObject

Returns the value of attribute part

Returns:

  • (Object)

    the current value of part



125
126
127
# File 'app/helpers/calagator/time_range_helper.rb', line 125

def part
  @part
end

#whichObject

Returns the value of attribute which

Returns:

  • (Object)

    the current value of which



125
126
127
# File 'app/helpers/calagator/time_range_helper.rb', line 125

def which
  @which
end

Instance Method Details

#to_sObject



139
140
141
142
143
144
145
# File 'app/helpers/calagator/time_range_helper.rb', line 139

def to_s
  if format == :hcal
    wrap_in_hcal(text, which)
  else
    text
  end
end