Method and variable name is the same

后端 未结 4 410
难免孤独
难免孤独 2020-12-03 18:29

If both a method and a variable has the same name it will use the variable.

hello = \"hello from variable\"

def hello
  \"hello from method\"
end

puts hell         


        
4条回答
提交回复
热议问题