[#62904] [ruby-trunk - Feature #9894] [Open] [RFC] README.EXT: document rb_gc_register_mark_object — normalperson@...
Issue #9894 has been reported by Eric Wong.
3 messages
2014/06/02
[#63321] [ANN] ElixirConf 2014 - Don't Miss Jos辿 Valim and Dave Thomas — Jim Freeze <jimfreeze@...>
Just a few more weeks until ElixirConf 2014!
6 messages
2014/06/24
[#63391] Access Modifiers (Internal Interfaces) — Daniel da Silva Ferreira <danieldasilvaferreira@...>
Hi,
3 messages
2014/06/28
[ruby-core:63342] [CommonRuby - Feature #8643] Add Binding.from_hash
From:
rr.rosas@...
Date:
2014-06-26 12:40:40 UTC
List:
ruby-core #63342
Issue #8643 has been updated by Rodrigo Rosenfeld Rosas.
File feature-8643.pdf added
Add slide for proposal
----------------------------------------
Feature #8643: Add Binding.from_hash
https://bugs.ruby-lang.org/issues/8643#change-47389
* Author: Rodrigo Rosenfeld Rosas
* Status: Open
* Priority: Normal
* Assignee: Koichi Sasada
* Category:
* Target version:
----------------------------------------
Binding.from_hash would work like:
class Binding
def self.from_hash(hash)
OpenStruct.new(hash){ binding }
end
end
It would simplify things like:
ERB.new(IO.read 'template.erb').result Binding.from_hash(template_local: 'example')
Or if you need to eval some code in another process (JRuby, for instance) and need to pass some arguments to the eval code in a hash form.
I didn't want to pollute Hash by adding Hash#to_binding. I believe Binding.from_hash is more appropriate.
---Files--------------------------------
feature-8643.pdf (19 KB)
--
https://bugs.ruby-lang.org/