Class: Temple::Filters::Eraser

Inherits:
Temple::Filter show all
Defined in:
lib/temple/filters/eraser.rb

Overview

Erase expressions with a certain type

Constant Summary

Constants included from Utils

Utils::ESCAPE_HTML, Utils::ESCAPE_HTML_PATTERN

Instance Attribute Summary

Attributes included from Mixins::Options

#options

Instance Method Summary collapse

Methods included from Mixins::Options

included, #initialize

Methods included from Mixins::ControlFlowDispatcher

#on_block, #on_case, #on_cond, #on_if

Methods included from Mixins::EscapeDispatcher

#on_escape

Methods included from Mixins::CoreDispatcher

#on_capture, #on_multi

Methods included from Mixins::CompiledDispatcher

#call

Methods included from Utils

#empty_exp?, #escape_html, #escape_html_safe, #indent_dynamic, #unique_name

Instance Method Details

#compile(exp) ⇒ Object



11
12
13
14
# File 'lib/temple/filters/eraser.rb', line 11

def compile(exp)
  exp.first == :multi || (do?(:keep, exp) && !do?(:erase, exp)) ?
    super(exp) : [:multi]
end