The Memento Pattern

Interesting pattern. I rewrote the code examples in pure Ruby objects of Struct and Hash. You can see my example on a comment in the blog post.

One thing I don’t like in his example use the use of post.save as a parameter. The method should be able to handle the object itself and do the saving internally.

1 Like