avdi / naught

A toolkit for building Null Object classes in Ruby
MIT License
1.05k stars 53 forks source link

Respond to methods from ancestors #16

Closed dragosmiron closed 11 years ago

dragosmiron commented 11 years ago

I would like to be able to null.methods, null.freeze etc. What do you think?

avdi commented 11 years ago

You mean you want them to have their original meaning? Or you want them to be stubbed?

dragosmiron commented 11 years ago

I was thinking to have original meaning. Right now every method (almost) return nil.

avdi commented 11 years ago

This is dependent on the base class you use. By default BasicObject is used, so those have no "original" meaning, because they aren't defined at all.

I just merged a change that lets you explicitly set the base class to Object if you want.