On Thu, Jan 9, 2014 at 5:37 PM, Previn Lin <lists / ruby-forum.com> wrote:
> May I ask one more question? As I know, instance variable should belongs
> to specific class, so here @lic_servers belongs to which class, Main
> class?

This is a great question. Actually, an instance variable belongs to an
*instance*, not a class. You can tell which instance by looking at the
self variable. At the top level self points to a magic object called
main (not Main) so that's where @lic_servers lives.

Type "self" and "self.class" at irb to see for yourself.

If it's still unclear, maybe my slides at
http://codelikethis.com/lessons/ruby_objects/objects#state will
clarify.

-- 
Alex Chaffee - alex / stinky.com
http://alexchaffee.com
http://codelikethis.com
http://twitter.com/alexch