Created: 2014-05-19 06:53
Updated: 2019-02-02 20:10
License: mit

Method not missing

Build Status Gem VersionCode Climate

Implements missing methods on the fly by googling their implementation on Because Ruby.

Instance variables are added when needed and missing classes are also declared at runtime.

There's some backtracking if the implementation found raises an error (like stack overflows) or if a nested method lookup fails.


gem install method_not_missing

External dependencies

  • PhantomJS ( brew install phantomjs on OSX )


require "method_not_missing"

object =
## Googling...
#=> [3]
#=> [3, 4]
#=> #<MethodNotMissing::OmnipotentObject:70308021738440 @uncounted=[3, 4]>

Future work:

  • Type Safety: since we get the arity of the requested function, we could filter out the ones with the wrong number of argument. This is implemented with exception-driven backtracking on ArgumentErrors right now.

  • Enterprise


  1. Fork it ([my-github-username]/method_not_missing/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more