Sha256: 384845e9d756b54ff0e451f7d19d8c930958e4df9adb152e9fc736c3d2ddf5c0
Contents?: true
Size: 682 Bytes
Versions: 15
Compression:
Stored size: 682 Bytes
Contents
module WLang class Compiler class Filter < Temple::Filter module ClassMethods def recurse_on(*kinds) kinds.each do |kind| define_method(:"on_#{kind}") do |*args| recurse(kind, *args) end end end end extend ClassMethods module InstanceMethods def recurse(kind, *args) args.inject [kind] do |rw,arg| rw << (arg.is_a?(Array) ? call(arg) : arg) end end end include InstanceMethods recurse_on :template, :fn, :wlang, :strconcat, :modulo, :static end # class Filter end # class Compiler end # module WLang
Version data entries
15 entries across 15 versions & 1 rubygems