method
formatted_code_for
v4.1.8 -
Show latest stable
- Class:
ActionView::Template::Error
formatted_code_for(source_code, line_counter, indent, output)private
No documentation available.
# File actionview/lib/action_view/template/error.rb, line 126
def formatted_code_for(source_code, line_counter, indent, output)
start_value = (output == :html) ? {} : ""
source_code.inject(start_value) do |result, line|
line_counter += 1
if output == :html
result.update(line_counter.to_s => "%#{indent}s %s\n" % ["", line])
else
result << "%#{indent}s: %s\n" % [line_counter, line]
end
end
end