Using % for printng strings

Hello comunity, I’m trying some code from ruby cookbook, and i have
this:

%{Here is number #{class InstantClass
def bar
“Some text”
end
end
InstantClass.new.bar
}.}

It is supposed to print me “Here is Some text” but, it doesn’t bring me
anything.

What can i do in this case o what could be the reason why it doesn’t
show anything?

Am 04.08.2013 19:45, schrieb David A.:

It is supposed to print me “Here is Some text” but, it doesn’t bring me
anything.

What can i do in this case o what could be the reason why it doesn’t
show anything?

You do not do anything with the string.

Use `puts %{…}’ to output the string to screen or enter
it into irb (which by default outputs the value of all
entered expressions)

Regards,
Marcus