How can I access a variable defined in a Ruby file I required in IRB?

前端 未结 4 1691
囚心锁ツ
囚心锁ツ 2020-12-01 18:33

The file welcome.rb contains:

welcome_message = \"hi there\"

But in IRB, I can\'t access the variable I just created:

4条回答
  •  孤城傲影
    2020-12-01 19:09

    That should at least enable the experience from irb:

    def welcome_message; "hi there" end
    

提交回复
热议问题