From: "ernie n." Date: 2013-04-12T12:50:25+09:00 Subject: Re: using an instance variable inside a method I'm a couple weeks as a Ruby newby ... writing a fun puzzle and ran into an issue I don't understand (read lots of books and searched ...). == class Board attr_accessor :type, :b, :p, :audit def initialize(type) @audit = Array.new @type = type # either 9 or 10 depending on puzzle type! @b = Hash.new(:OOB) # default for OOB @p = Array.new # position of all the Pieces within the block if(type == 9) p[6] = Piece.new(6,1,1,:Obt) p[7] = Piece.new(7,2,1,:Obt) else ... == Why can I access p[6] without the "@" within the class? I've run this in pry/irb and the p array looks the same regardless how I reference it - either @p or p. What's up here? Thx -- Posted via http://www.ruby-forum.com/.