martincik / acts_as_nullobject Goto Github PK
View Code? Open in Web Editor NEWInstead of using a null reference to convey absence of an object (for instance, a non-existent customer), one uses an object which implements the expected interface, but whose method body is empty. The advantage of this approach over a working default implementation is that a Null Object is very predictable and has no side effects: it does nothing. This project is Rails plugin.
Home Page: http://en.wikipedia.org/wiki/Null_object_pattern