class Slim::OutputProtector
@api private
Public Instance Methods
call(exp)
click to toggle source
Calls superclass method
# File lib/slim/embedded.rb, line 33 def call(exp) @protect, @collected, @tag = [], ''.dup, object_id.abs.to_s(36) super(exp) @collected end
on_slim_output(escape, text, content)
click to toggle source
# File lib/slim/embedded.rb, line 44 def on_slim_output(escape, text, content) @collected << "%#{@tag}%#{@protect.length}%" @protect << [:slim, :output, escape, text, content] nil end
on_static(text)
click to toggle source
# File lib/slim/embedded.rb, line 39 def on_static(text) @collected << text nil end
unprotect(text)
click to toggle source
# File lib/slim/embedded.rb, line 50 def unprotect(text) block = [:multi] while text =~ /%#{@tag}%(\d+)%/ block << [:static, $`] block << @protect[$1.to_i] text = $' end block << [:static, text] end