Class: Erubis::Context
Overview
This is added to the Erubis Content class to allow the same helper methods to be used with both Markaby and Erubis.
Constant Summary
Waves::Helpers::TagHelper::ESCAPE_TABLE
Instance Method Summary
collapse
#number_with_delimiter
#image_path, #image_tag
#escape_once, #h, #tag
#link_to, #url_for
Instance Method Details
13
14
15
|
# File 'lib/renderers/erubis.rb', line 13
def <<(s)
eval("_buf", @binding).concat s end
|
17
18
19
20
21
22
|
# File 'lib/renderers/erubis.rb', line 17
def capture
eval("_context.push(_buf); _buf = ''", @binding) result = Erubis::Eruby.new(yield).result @binding
eval("_buf = _context.pop", @binding)
result
end
|
#render(eruby) ⇒ Object
24
25
26
27
28
29
30
|
# File 'lib/renderers/erubis.rb', line 24
def render(eruby)
unless @binding
@binding = binding
eval("_buf = ''; _context = []", @binding)
end
eruby.result @binding
end
|