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 => ' '
}.freeze
SUFFIXES =
{
  month: ' ',
  wday: ', '
}.freeze

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



132
133
134
# File 'app/helpers/calagator/time_range_helper.rb', line 132

def format
  @format
end

#partObject

Returns the value of attribute part

Returns:

  • (Object)

    the current value of part



132
133
134
# File 'app/helpers/calagator/time_range_helper.rb', line 132

def part
  @part
end

#whichObject

Returns the value of attribute which

Returns:

  • (Object)

    the current value of which



132
133
134
# File 'app/helpers/calagator/time_range_helper.rb', line 132

def which
  @which
end

Instance Method Details

#to_sObject



146
147
148
149
150
151
152
# File 'app/helpers/calagator/time_range_helper.rb', line 146

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