class Asciidoctor::Converter::BuiltIn
An abstract base class for built-in {Converter} classes.
Public Class Methods
# File lib/asciidoctor/converter/base.rb, line 16 def initialize backend, opts = {} end
Public Instance Methods
Public: Returns the converted content of the {AbstractNode}.
Returns the converted [String] content of the {AbstractNode}.
# File lib/asciidoctor/converter/base.rb, line 41 def content node node.content end
Public: Converts the specified {AbstractNode} using the specified transform and optionally additional options (when not empty).
CAUTION: Method that handles the specified transform *may not* accept the
second argument with additional options, in which case an {ArgumentError}
is raised if the given opts
Hash
is not nil. The additional options are used in template-based backends to
access convert helper methods such as outline.
See {Converter#convert} for more details.
Returns the [String] result of conversion
# File lib/asciidoctor/converter/base.rb, line 31 def convert node, transform = nil, opts = {} transform ||= node.node_name opts.empty? ? (send transform, node) : (send transform, node, opts) end
Public: Skips conversion of the {AbstractNode}.
Returns [NilClass]
# File lib/asciidoctor/converter/base.rb, line 50 def skip node nil end