lib/barby/outputter.rb
def with_options(options={})
      original_options = options.inject({}) do |origs,pair|
        if respond_to?(pair.first) && respond_to?("#{pair.first}=")
          origs[pair.first] = send(pair.first)
          send("#{pair.first}=", pair.last)
        end
        origs
      end

      rv = yield

      original_options.each do |attribute,value|
        send("#{attribute}=", value)
      end

      rv
    end
def with_options(options={})
      original_options = options.inject({}) do |origs,pair|
        if respond_to?(pair.first) && respond_to?("#{pair.first}=")
          origs[pair.first] = send(pair.first)
          send("#{pair.first}=", pair.last)
        end
        origs
      end

      rv = yield

      original_options.each do |attribute,value|
        send("#{attribute}=", value)
      end

      rv
    end
Takes a hash and temporarily sets properties on self (the outputter object)
corresponding with the keys to their values. When the block exits, the
properties are reset to their original values. Returns whatever the block returns.