Borges::StateHolder (Class)

In: lib/Borges/Utilities/StateHolder.rb
Parent: Object

A Borges::StateHolder backtracks itself, restoring previous versions of the object it holds when a user uses the back button. The StateHolder does not backtrack the object it holds.

For example:

  obj = 5
  st = obj
  # page is rendered, user causes this action to take place:
  st.contents = 7
  # user goes back to the first page
  puts st.contents # => 5




contents  [RW]  The object the StateHolder should backtrack.

Public Class methods

Wraps object, and registers the StateHolder for backtracking.