変数
参考:
変数・定数 | Ruby 入門 (www.tohoho-web.com)
local_variables
参考:
module function Kernel.#local_variables (Ruby 2.6.0)
ローカル変数に変数名でアクセスする
binding
とシンボルを使って変数を取得する。
binding.local_variable_get(:var_name)
参考:
instance method Binding#local_variable_get (Ruby 2.6.0)
Get value from string representing local variable – Stack Overflow