def spin
      synchronize do
        return if @done
        emit(:spin)

        if @hide_cursor && !spinning?
          write(TTY::Cursor.hide)
        end

        data = message.gsub(MATCHER, @frames[@current])
        data = replace_tokens(data)
        write(data, true)
        @current = (@current + 1) % @length
        @state = :spinning
        data
      end
    end
def spin
      synchronize do
        return if @done
        emit(:spin)

        if @hide_cursor && !spinning?
          write(TTY::Cursor.hide)
        end

        data = message.gsub(MATCHER, @frames[@current])
        data = replace_tokens(data)
        write(data, true)
        @current = (@current + 1) % @length
        @state = :spinning
        data
      end
    end
Perform a spin

 @return [String]
   the printed data

 @api public