On Sun, Dec 18, 2011 at 05:20:19AM +0900, ANDREW BIZYAEV (GMAIL) wrote:
> Hello, Ruby experts.
> Imagine I have single quoted string: 
> a = 'bla bla #{name} bla bla'
> name = 'Andrew'
> Is it possible to make a act as double quoted string: puts a => 'bla
> bla Andrew bla bla' instead of' bla bla #{name} bla bla'?

Why do you need to use single quotes?  If you just want to avoid using
double quotes (perhaps because you want double quotes within the string),
you could use something like this instead:

    name = 'Andrew'
    puts %Q{blah blah #{name} blah blah}

If you want to be able to reuse the string, you could define a method:

    def a(name_input)
      %Q{blah blah #{name_input} blah blah}
    end

    name = 'Andrew'

    puts a(name)