# File lib/asciidoctor/abstract_block.rb, line 415
  def assign_caption value = nil, key = nil
    unless @caption || !@title || (@caption = value || @document.attributes['caption'])
      if (prefix = @document.attributes[%(#{key ||= @context}-caption)])
        @caption = %(#{prefix} #{@number = @document.increment_and_store_counter "#{key}-number", self}. )
        nil
      end
    end
  end