injekt/slop — Issue #36: Slop "opts" object uses method_missing for "option?" methods
Author: epitron
Created: 2011-11-24 08:53:18+00:00
State: open

Using method_missing here causes problems when methods are added to Object.

Example: https://github.com/pry/pry/blob/master/lib/pry/default_commands/shell.rb#L91

My library adds an `#in?` method to `Object`, which breaks Pry like so:

```
[7] pry(main)> [].each_cons :barf
TypeError: can't convert Symbol into Integer
from (pry):2:in `each_cons'
[8] pry(main)> cat --ex
ArgumentError: wrong number of arguments (0 for 1)
from /home/epi/.rvm/gems/ruby-1.9.3-rc1/gems/epitools-0.5.2/lib/epitools/basetypes.rb:817:in `in?'
[9] pry(main)>
```

Solutions:
* `define_method` the methods
* Inherit from BasicObject instead of Object