module Kramdown::Utils::Configurable
def configurable(name)
add_
object.
configurables:: Returns a hash of hashes that is used to store all configurables of the
extension:
Three methods will be defined on the calling object which allow to use this configurable
Create a new configurable extension called +name+.
def configurable(name) unless respond_to?(:configurables) singleton_class.send(:define_method, :configurables) do @_configurables ||= Hash.new {|h, k| h[k] = {} } end end singleton_class.send(:define_method, name) do |data| configurables[name][data] end singleton_class.send(:define_method, "add_#{name}".intern) do |data, *args, &block| configurables[name][data] = args.first || block end end