class Paru::PandocFilter::Caption

A table or figure’s caption, can contain an optional short caption

Attributes

short[RW]

Public Class Methods

new(contents) click to toggle source

Create a new Caption based on the contents

@param contents [Array]

Calls superclass method
# File lib/paru/filter/caption.rb, line 34
def initialize(contents)
    if contents[0].nil?
      @short = nil
    else
      @short = ShortCaption.new contents[0]
    end
    super(contents[1])
end

Public Instance Methods

ast_contents() click to toggle source

The AST contents of this Caption node

@return [Array]

# File lib/paru/filter/caption.rb, line 60
def ast_contents()
    [
      if has_short? then @short.to_ast else nil end,
      @children.map {|row| row.to_ast}
    ]
end
has_block?() click to toggle source

Has this node a block?

@return [Boolean] true

# File lib/paru/filter/caption.rb, line 53
def has_block?
    true
end
has_short?() click to toggle source

Does this Caption have a short caption?

@return [Boolean]

# File lib/paru/filter/caption.rb, line 46
def has_short?()
    not @short.nil?
end
to_ast() click to toggle source

Create an AST representation of this Node

@return [Hash]

# File lib/paru/filter/caption.rb, line 70
def to_ast()
  ast_contents()
end