From: Matthew Kerwin Date: 2014-03-29T08:58:03+10:00 Subject: [ruby-core:61746] Re: [CommonRuby - Feature #9686] Syntax for symbols used in hashes --001a11c1092e5b4a0204f5b2a218 Content-Type: text/plain; charset=ISO-8859-1 On Mar 29, 2014 8:52 AM, wrote: > > You can write simply for that case: > > ~~~ruby > string = 'foo' > {string => 'bar'} > ~~~ You'd need ~~~ruby {string.to_s => 'bar'} ~~~ --001a11c1092e5b4a0204f5b2a218 Content-Type: text/html; charset=ISO-8859-1

On Mar 29, 2014 8:52 AM, <nobu@ruby-lang.org> wrote:
>
> You can write simply for that case:
>
> ~~~ruby
> string = 'foo'
> {string => 'bar'}
> ~~~

You'd need

~~~ruby
{string.to_s => 'bar'}
~~~

--001a11c1092e5b4a0204f5b2a218--