Class: Temple::HTML::Filter

Inherits:
Filter show all
Includes:
Dispatcher
Defined in:
lib/temple/html/filter.rb

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 Dispatcher

#on_html_attr, #on_html_attrs, #on_html_comment, #on_html_condcomment, #on_html_js, #on_html_tag

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, #compile

Methods included from Utils

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

Instance Method Details

#contains_nonempty_static?(exp) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/temple/html/filter.rb', line 8

def contains_nonempty_static?(exp)
  case exp.first
  when :multi
    exp[1..-1].any? {|e| contains_nonempty_static?(e) }
  when :escape
    contains_nonempty_static?(exp.last)
  when :static
    !exp.last.empty?
  else
    false
  end
end