Tag Archives: wrapper pattern

Ruby: Overriding Class.new to make custom wrapper pattern

If you have a class Content and you call Content.new, you’ll get back an object of class Content. This is normal and expected. If you want something that is abnormal and unexpected to occur, this recipe is for you. While here we just implement a simple wrapper pattern, you could just as easily have Content.new [...]

Also tagged | 1 Comment