class ActionView::Helpers::TextHelper::Cycle

:nodoc:

def current_value

def current_value
  @values[previous_index].to_s
end

def initialize(first_value, *values)

def initialize(first_value, *values)
  @values = values.unshift(first_value)
  reset
end

def next_index

def next_index
  step_index(1)
end

def previous_index

def previous_index
  step_index(-1)
end

def reset

def reset
  @index = 0
end

def step_index(n)

def step_index(n)
  (@index + n) % @values.size
end

def to_s

def to_s
  value = @values[@index].to_s
  @index = next_index
  value
end