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" 😆)

Follow

@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

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!