lib/core/object.rb
def change_attr attr, val, &block
    old_val = instance_variable_get attr
    begin
      instance_variable_set attr, val
      yield
    ensure
      instance_variable_set attr, old_val
    end
  end
# === Description
#
# Change +attr+ to +val+ within the scope of block
# and then sets it back again
#
Description
Change +attr+ to +val+ within the scope of block
and then sets it back again
Description Change + attr + to + val + within the scope of block and then sets it back again
def change_attr attr, val, &block
    old_val = instance_variable_get attr
    begin
      instance_variable_set attr, val
      yield
    ensure
      instance_variable_set attr, old_val
    end
  end
def change_attr attr , val , & block old_val = instance_variable_get attr begin instance_variable_set attr , val yield ensure instance_variable_set attr , old_val end end
Description
Change +attr+ to +val+ within the scope of block
and then sets it back again
Description Change + attr + to + val + within the scope of block and then sets it back again
attr
val
block