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?

···

--
Posted via http://www.ruby-forum.com/.

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

···

Am 04.08.2013 19:45, schrieb David Acosta:

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?

--
GitHub: stomar (Marcus Stollsteimer) · GitHub
PGP: 0x6B3A101A