Sha256: 4859b78b5711e5884538eacf3c5355b9429de24e137c49f5ce5b926806e86023
Contents?: true
Size: 343 Bytes
Versions: 9
Compression:
Stored size: 343 Bytes
Contents
module MiscHelpers # copy'n'paste from plataformatec/show_for def swap(object, new_values) old_values = {} new_values.each do |key, value| old_values[key] = object.send key object.send :"#{key}=", value end yield ensure old_values.each do |key, value| object.send :"#{key}=", value end end end
Version data entries
9 entries across 9 versions & 1 rubygems