Take the 2-minute tour ×  Just wondering why  def move
world_switch(@pos_X += 1, @pos_X -= 1, @pos_Y += 1, @pos_Y -= 1)
def world_switch(do_on_north, do_on_south, do_on_east,
do_on_west)     case @facing # => 'NORTH'     when 'NORTH'
puts do_on_north # => 1     when 'SOUTH'     when 'EAST'
when 'WEST'  Calling world_switch:  robot = Robot.new(0, 0,
'NORTH') puts robot.instance_variable_get("@pos_X") #=> 0
results in changing nothing, I would like to increase or
decrease instance variable @pos_X or @pos_Y  This is my
initialize method  def initialize(pos_X, pos_Y, facing)  and
that's how I create an instance of the class robot =
Robot.new(0, 0, 'NORTH')  All help will be appreciated
share|improve this question How do you call world_switch? The
one above cannot run. And world_switch should not defined like
that. Since it accepts only instance variables as parameters, we
can omit them all. The self can provide access to them. – 
halfelf Sep 27 '12 at 9:31 1. It is better to use symbols rather
th