Follow

How ERB uses `Binding` objects:

class DiyErb
def initialize(template)
@template = template
end

def result(binding)
@template.gsub(/<%=(.+?)%>/) do
binding.eval($1)
end
end
end

blog.appsignal.com/2019/01/08/

@jkreeftmeijer Excellent writeup!

(Can you also believe the first thing I did was search for the word "Thus" 😆)

@timriley Thanks Tim, that means a lot. I’ll do my best to remember to hide a “therefore” in the next one. 🧐

Sign in to participate in the conversation
Mastodon

Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!