def act(environment)
    environment.objects.each do |object|
      if (object.location.x < @left) then
        object.location.x = @right
      elsif (object.location.x > @right) then
        object.location.x = @left
      end
      if (object.location.y > @top) then
        object.location.y = @bottom
      elsif (object.location.y < @bottom) then
        object.location.y = @top
      end
    end
  end
def act(environment)
    environment.objects.each do |object|
      if (object.location.x < @left) then
        object.location.x = @right
      elsif (object.location.x > @right) then
        object.location.x = @left
      end
      if (object.location.y > @top) then
        object.location.y = @bottom
      elsif (object.location.y < @bottom) then
        object.location.y = @top
      end
    end
  end
Takes a hash with these keys and defaults:
  :left => 0
  :top => 0
  :right => 0
  :bottom => 0
If object is beyond a boundary, set its position to that of opposite boundary.