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: fitter.rb
    path of file: ./repos/shoes4/shoes-swt/lib/shoes/swt/text_block
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class Shoes
  module Swt
    class TextBlock
      class Fitter
        attr_reader :parent

 
    
        def available_space
          width = @dsl.desired_width
          height = next_line_start - @dsl.absolute_top - 1

          if on_new_line?
            height = :unbounded

            # Try to find a parent container we fit in.
            # If that doesn't work, just bail with [0,0] so we don't crash.
            width = width_from_ancestor if width <= 0
            return [0, 0] if width.negative?
          end

          [width, height]
        end