Issue #10130 has been updated by Yukihiro Matsumoto.

Category set to core
Status changed from Open to Rejected
Assignee set to Yukihiro Matsumoto

Rejected, for several reasons:

(1) author.name is not a canonical way to access nested hash.
(2) this feature add more complexity than it gains.
(3) you can just use #{author[:name]} to embed.

Matz.



----------------------------------------
Feature #10130: String format with nested hash
https://bugs.ruby-lang.org/issues/10130#change-48328

* Author: Tsuyoshi Sawada
* Status: Rejected
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* Category: core
* Target version: 
----------------------------------------
When we do string format with hashes, we have the restriction that the hash cannot be a nested one. When we want to handle more complicated string formats, for example in templates, it is more convenient if we can use a nested hash.

    "Author: %{author.name} (%{author.affiliation}), %{date}" % {author: {name: "Ruby Taro", affiliation: "Ruby co."}, date: "2014, 8, 14"}
    #=> "Author: Ruby Taro (Ruby co.), 2014, 8, 14"



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