What does the “$” character mean in Ruby?

前端 未结 5 1651
深忆病人
深忆病人 2020-12-08 01:40

Been playing with Ruby on Rails for awhile and decided to take a look through the actual source. Grabbed the repo from GitHub and started looking around. Came across some co

5条回答
  •  一个人的身影
    2020-12-08 02:14

    $ identifies a global variable, as opposed to a local variable, @instance variable, or @@class variable.

    Among the language-supplied global variables are $:, which is also identified by $LOAD_PATH

提交回复
热议问题