Previous definition of was here.

37 visualizações
Pular para a primeira mensagem não lida

butsan...@gmail.com

não lida,
7 de mai. de 2017, 01:51:1507/05/2017
para Ruby on Rails: Talk

I have 2 warnings before output. What is the problem?

Hello = "Hello, guys!"
Hello2 = nil
Hello2 = Hello
puts Hello2
puts Hello


OUTPUT________________
Variables.rb:7: warning: already initialized constant Hello2
Variables.rb:5: warning: previous definition of Hello2 was here
Hello, guys!
Hello, guys!

Colin Law

não lida,
7 de mai. de 2017, 03:51:5307/05/2017
para Ruby on Rails: Talk
Variables that begin with a capital letter are assumed by ruby to be
constants, so you get a warning if you try to change the value. Using
Rails it best to stick to the conventions, so variable names are of
the form name, another_name and so on.

Colin

butsan...@gmail.com

não lida,
7 de mai. de 2017, 17:32:3907/05/2017
para Ruby on Rails: Talk
Thank you a lot!

воскресенье, 7 мая 2017 г., 10:51:53 UTC+3 пользователь Colin Law написал:
Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem