lgedeon/Live-Cache — pull request #1 by ericmann (2012-11-16 17:07:52+00:00)
Title: Object Refactoring

The `Live_Cache` object has been converted into a function that can instantiate an object, called `Live_Cache_Obj()`. To instantiate, just set `var Live_Cache = new Live_Cache_Obj()`.

This new version of the object has both private and public variables. Private variables are contained within the object's closure scope and defined with `var` inside the object. Public variables are defined as `this.variable_or_method_name`.

Private variables can, obviously, only be used within the object itself. Since they're in the object's scope, they can even be referenced inside local callbacks like within the `jQuery.get()` return.

Public variables/methods can be referenced externally as `Live_cache.check()`. Internally they're referenced as `self.check()` since `self` maintains a reference to the original scope of the object upon its instantiation.