class WWW::Mechanize

def transact

given as a parameter to the block. Returns the value of the block.
Runs given block, then resets the page history as it was before. self is
def transact
  history_backup = @history.dup
  begin
    yield self
  ensure
    @history = history_backup
  end
end