Difference between Large Molecular Variables and $, $$ Variables in Ruby on Rails

Asked 2 years ago, Updated 2 years ago, 31 views

Is there a difference between a large molecular variable and a $,$ variable in Ruby on Rails?

I'm trying to save and write the values I'm going to use globally for the file under rails' config/initials/, but I don't know which one is the best.

ruby ruby-on-rails

2022-09-22 13:45

1 Answers

Variables starting with capital letters are Constants, variables starting with $ are global variables, and $$ is the variable representing the process ID (PID) of the interpreter (interpreter, Interpreter) that runs the script. If you want to use global variables, use $^

^


2022-09-22 13:45

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.