From: matz@... Date: 2014-07-26T05:39:49+00:00 Subject: [ruby-core:64032] [ruby-trunk - Feature #8631] Add a new method to ERB to allow assigning the local variables from a hash Issue #8631 has been updated by Yukihiro Matsumoto. I like the idea, but I have one concern. The binding also has information about the receiver (which defaults to top-level self). I am not sure whether it's critical or not. I hope Seki will address this. Matz. ---------------------------------------- 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-48045 * Author: Rodrigo Rosenfeld Rosas * Status: Assigned * Priority: Low * Assignee: 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 } ---Files-------------------------------- feature-8631.pdf (27.7 KB) -- https://bugs.ruby-lang.org/