You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: column.rb
    path of file: ./repos/trestle/lib/trestle/table
    
    the code of the file until where you have to start completion: module Trestle
  class Table
    class Column
      attr_reader :field, :options, :block

      def initialize(field, options={}, &block)
        @field, @options = field, options
        @block = block if block_given?
      end

      def renderer(table:, template:)
        Renderer.new(self, table: table, template: template)
      end

      def sortable?
        options[:sort] != false && (!@block || options.has_key?(:sort))
      end

      def sort_field
        if options[:sort].is_a?(Hash)
          options[:sort][:field] || field
        else
          options[:sort] || field
        end
      end

      def sort_options
        options[:sort].is_a?(Hash
    
        def column_value(instance)
          if @column.block
            if block_is_legacy_haml?
              # In order for table column blocks to work properly within Haml templates,
              # the _hamlout local variable needs to be defined in the scope of the block,
              # so that the Haml version of the capture method is used. Because we
              # evaluate the block using instance_exec, we need to set this up manually.
              -> {
                _hamlout = eval('_hamlout', @column.block.binding)
                value = nil
                buffer = @template.capture { value = @template.instance_exec(instance, &@column.block) }
                value.is_a?(String) ? buffer : value
              }.call
            else
              # Capture both the immediate value and captured output of the block.
              # If the result of the block is a string, then use the contents of the buffer.
              # Otherwise return the result of the block as a raw value (for auto-formatting).
              value = nil
              buffer = @template.capture { value = @template.instance_exec(instance, &@column.block) }
              value.is_a?(String) ? buffer : value
            end