# File lib/asciidoctor/extensions.rb, line 196 def process *args, &block if block_given? raise ::ArgumentError, %(wrong number of arguments (given #{args.size}, expected 0)) unless args.empty? @process_block = block # TODO enable if we want to support passing proc or lambda as argument instead of block #elsif ::Proc === args[0] # block = args.shift # raise ::ArgumentError, %(wrong number of arguments (given #{args.size}, expected 0)) unless args.empty? # @process_block = block elsif defined? @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 # TODO add exception message here raise ::NotImplementedError end end