Issue #8631 has been updated by rosenfeld (Rodrigo Rosenfeld Rosas).


I didn't propose an API because I don't really care about the API as long as it allows us to provide a hash instead of a binding.

If you want an example API that would satisfy me, I'd be happy if we used the same API (ERB#result). If the argument is a hash, use the keys as the local variables and the values as the variable values.
----------------------------------------
Feature #8631: Add a new method to ERB to allow assigning the local variables from a hash
https://bugs.ruby-lang.org/issues/8631#change-40506

Author: rosenfeld (Rodrigo Rosenfeld Rosas)
Status: Assigned
Priority: Low
Assignee: seki (Masatoshi Seki)
Category: 
Target version: 


It would be interesting if ERB could allow a hash instead of a binding for processing the template.

We wouldn't have to do hacks like:

b = OpenStruct.new(hash).instance_eval{ binding }



-- 
http://bugs.ruby-lang.org/