[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

what's the diff between puts y and puts "#{y}" in class_eval

Raj Singh

1/28/2008 7:23:00 AM

Look at the code.

y = " another hi"

class Wes
end

Wes.class_eval <<-END
def hello
puts "#{y}"
puts y # I get wrong number of arguments error
end
END


While puts "#{y}" works puts y fails. And I am not sure what's the
explanation.

Any thoughts.
--
Posted via http://www.ruby-....