Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
ERB#result_with_hash
(::Hash[untyped, untyped]) -> ::String
result_with_hash(hash)
lib/erb.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/erb.rb, line 433
def result_with_hash(hash)
b = new_toplevel(hash.keys)
hash.each_pair do |key, value|
b.local_variable_set(key, value)
end
result(b)
end
Render a template on a new toplevel binding with local variables specified by a Hash object.