{"issue":{"created_at":"2011-11-24T08:53:18Z","state":"closed","updated_at":"2011-11-25T19:08:26Z","comments":8,"user":{"gravatar_id":"2c0dd5a3c0ce7bed6898ef7d25afe818","id":16409,"url":"https://api.github.com/users/epitron","login":"epitron","avatar_url":"https://secure.gravatar.com/avatar/2c0dd5a3c0ce7bed6898ef7d25afe818?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Using `method_missing` to receive \"option?\" messages causes problems when someone defines an \"option?\" method on Object -- the overridden method gets called instead of Slop's.\r\n\r\nFor example, pry has an `#in?` option: https://github.com/pry/pry/blob/master/lib/pry/default_commands/shell.rb#L91\r\n\r\nMeanwhile, my library adds `#in?` to `Object`, which breaks pry thusly:\r\n\r\n```\r\n[7] pry(main)> [].each_cons :barf\r\nTypeError: can't convert Symbol into Integer\r\nfrom (pry):2:in `each_cons'\r\n[8] pry(main)> cat --ex\r\nArgumentError: wrong number of arguments (0 for 1)\r\nfrom /home/epi/.rvm/gems/ruby-1.9.3-rc1/gems/epitools-0.5.2/lib/epitools/basetypes.rb:817:in `in?'\r\n[9] pry(main)>\r\n```\r\n\r\nSolutions:\r\n* `define_method` the methods\r\n* Inherit from BasicObject instead of Object\r\n","assignee":null,"number":36,"id":2338640,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"Slop \"opts\" object uses method_missing for \"option?\" methods","closed_at":"2011-11-25T18:49:03Z","html_url":"https://github.com/injekt/slop/issues/36","url":"https://api.github.com/repos/injekt/slop/issues/36","milestone":null},"action":"created","comment":{"created_at":"2011-11-25T19:08:26Z","updated_at":"2011-11-25T19:08:26Z","user":{"gravatar_id":"2c0dd5a3c0ce7bed6898ef7d25afe818","id":16409,"url":"https://api.github.com/users/epitron","login":"epitron","avatar_url":"https://secure.gravatar.com/avatar/2c0dd5a3c0ce7bed6898ef7d25afe818?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"http://as.rubyonrails.org/classes/Object.html","id":2877303,"url":"https://api.github.com/repos/injekt/slop/issues/comments/2877303"}}