Project

General

Profile

Actions

Feature #10130

closed

String format with nested hash

Added by sawa (Tsuyoshi Sawada) over 9 years ago. Updated over 8 years ago.

Status:
Rejected
Target version:
-
[ruby-core:64349]

Description

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"
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0