Class: ERB

Inherits:
Object
  • Object
show all
Defined in:
lib/tagen/erb.rb

Instance Method Summary collapse

Instance Method Details

#result_with_tagen(bind = nil, locals = {}) ⇒ Object Also known as: result

erb = Erb.new(“<%=a%>”)

erb.result(nil, a: 1) #=> "1"


13
14
15
16
17
18
19
20
# File 'lib/tagen/erb.rb', line 13

def result_with_tagen(bind=nil, locals={})
  bind ||= TOPLEVEL_BINDING
  if locals.empty?
    result_without_tagen bind
  else
    result_with_locals bind, locals
  end
end