# File lib/mustache/generator.rb, line 93 def on_section(name, content) # Convert the tokenized content of this section into a Ruby # string we can use. code = compile(content) # Compile the Ruby for this section now that we know what's # inside the section. ev("if v = ctx[\#{name.to_sym.inspect}]\nif v == true\n\#{code}\nelsif v.is_a?(Proc)\nv.call(\#{code})\nelse\nv = [v] unless v.is_a?(Array) # shortcut when passed non-array\nv.map { |h| ctx.push(h); r = \#{code}; ctx.pop; r }.join\nend\nend\n") end