class Temple::Filters::Eraser
Erase expressions with a certain type
@api public
Public Instance Methods
compile(exp)
click to toggle source
Calls superclass method
# File lib/temple/filters/eraser.rb, line 11 def compile(exp) exp.first == :multi || (do?(:keep, exp) && !do?(:erase, exp)) ? super(exp) : [:multi] end
Protected Instance Methods
do?(list, exp)
click to toggle source
# File lib/temple/filters/eraser.rb, line 18 def do?(list, exp) options[list].to_a.map {|type| [*type] }.any? {|type| exp[0,type.size] == type } end