Internal: Overlays a builder DSL for configuring the Processor instance. Includes a method to define configuration options and another to define the {Processor#process} method.
# File lib/asciidoctor/extensions.rb, line 140 def option key, value config[key] = value end
# File lib/asciidoctor/extensions.rb, line 144 def process *args, &block # need to check for both block/proc and lambda # TODO need test for this! #if block_given? || (args.size == 1 && ((block = args[0]).is_a? ::Proc)) if block_given? @process_block = block elsif @process_block # NOTE Proc automatically expands a single array argument # ...but lambda doesn't (and we want to accept lambdas too) # TODO need a test for this! @process_block.call(*args) else raise ::NotImplementedError end end
alias :process_with :process
# File lib/asciidoctor/extensions.rb, line 161 def process_block_given? defined? @process_block end