Ruby Instance Variables or Local Variables?
问题 I am new to Ruby language. I understand that @@count: Class variables @name: Instance variables my_string: Local variables I keep the above in mind. However, I found one Ruby code like this: class HBaseController < ApplicationController ... def result conn = OkHbase::Connection.new(host: 'localhost', port: 9090, auto_connect: true) ... end end 'conn' confuses me a lot. Is 'conn' a instance variable, or local variable? And what is the scope of 'conn'? 回答1: I try to explain it with a little