class Slim::OutputProtector
@api private
Public Instance Methods
call(exp)
click to toggle source
Calls superclass method
# File lib/slim/embedded.rb, line 32 def call(exp) @protect, @collected, @tag = [], '', "%#{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 43 def on_slim_output(escape, text, content) @collected << @tag @protect << [:slim, :output, escape, text, content] nil end
on_static(text)
click to toggle source
# File lib/slim/embedded.rb, line 38 def on_static(text) @collected << text nil end
unprotect(text)
click to toggle source
# File lib/slim/embedded.rb, line 49 def unprotect(text) block = [:multi] while text =~ /#{@tag}/ block << [:static, $`] block << @protect.shift text = $' end block << [:static, text] end