ruby-changes:63197
From: Yusuke <ko1@a...>
Date: Tue, 29 Sep 2020 14:40:21 +0900 (JST)
Subject: [ruby-changes:63197] 2e947bc181 (master): doc/syntax/literals.rdoc: explain `#@foo` and `#$foo`
https://git.ruby-lang.org/ruby.git/commit/?id=2e947bc181 From 2e947bc181794d1bcf26d700b2c2c15b53c45b36 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Tue, 29 Sep 2020 14:39:21 +0900 Subject: doc/syntax/literals.rdoc: explain `#@foo` and `#$foo` diff --git a/doc/syntax/literals.rdoc b/doc/syntax/literals.rdoc index e58430e..c871d27 100644 --- a/doc/syntax/literals.rdoc +++ b/doc/syntax/literals.rdoc @@ -143,6 +143,9 @@ Double-quote strings allow interpolation of other values using https://github.com/ruby/ruby/blob/trunk/doc/syntax/literals.rdoc#L143 Any expression may be placed inside the interpolated section, but it's best to keep the expression small for readability. +You can also use <tt>#@foo</tt> and <tt>#$foo</tt> as a shorthand for, +respentively, <tt>#{ @foo }</tt> and <tt>#{ $foo }</tt>. + Interpolation may be disabled by escaping the "#" character or using single-quote strings: -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/