class Kramdown::Document
def method_missing(id, *attr, &block)
class (i.e. a class in the Kramdown::Converter module) and use it for converting the document.
Check if a method is invoked that begins with +to_+ and if so, try to instantiate a converter
def method_missing(id, *attr, &block) if id.to_s =~ /^to_(\w+)$/ Converter.const_get($1[0..0].upcase + $1[1..-1]).convert(self) else super end end