lib/asciidoctor/abstract_block.rb
# Public: Generate and assign caption to block if not already assigned.
#
# If the block has a title and a caption prefix is available for this block,
# then build a caption from this information, assign it a number and store it
# to the caption attribute on the block.
#
# If a caption has already been assigned to this block, do nothing.
#
# The parts of a complete caption are: <prefix> <number>. <title>
# This partial caption represents the part the precedes the title.
#
# value - The explicit String caption to assign to this block (default: nil).
# key   - The String prefix for the caption and counter attribute names.
#         If not provided, the name of the context for this block is used.
#         (default: nil)
#
# Returns nothing.
Generate and assign caption to block if not already assigned.
If the block has a title and a caption prefix is available for this block,
then build a caption from this information, assign it a number and store it
to the caption attribute on the block.

If a caption has already been assigned to this block, do nothing.

The parts of a complete caption are:  . 
This partial caption represents the part the precedes the title.

The explicit String caption to assign to this block (default: nil).
key   - The String prefix for the caption and counter attribute names.
If not provided, the name of the context for this block is used.
(default: nil)

Returns nothing.
Generate and assign caption to block if not already assigned . If the block has a title and a caption prefix is available for this block then build a caption from this information assign it a number and store it to the caption attribute on the block . If a caption has already been assigned to this block do nothing . The parts of a complete caption are : . This partial caption represents the part the precedes the title . The explicit String caption to assign to this block ( default : nil ) . key - The String prefix for the caption and counter attribute names . If not provided the name of the context for this block is used . ( default : nil ) Returns nothing .
def assign_caption value = nil, key = nil
    unless @caption || !@title || (@caption = value || @document.attributes['caption'])
      if (prefix = @document.attributes[%(#{key ||= @context}-caption)])
        @caption = %(#{prefix} #{@numeral = @document.increment_and_store_counter "#{key}-number", self}. )
        nil
      end
    end
  end
def assign_caption value = nil , key = nil unless @caption || ! @title || ( @caption = value || @document . attributes [ 'caption' ] ) if ( prefix = @document . attributes [ %(#{key ||= @context}-caption) ] ) @caption = %(#{prefix} #{@numeral = @document.increment_and_store_counter "#{key}-number", self}. ) nil end end end
Public: Generate and assign caption to block if not already assigned.
Public : Generate and assign caption to block if not already assigned .
value
<not_specific>
key
<not_specific>