Skip to content

Instantly share code, notes, and snippets.

@cheezy
Created October 20, 2011 20:21
Show Gist options
  • Save cheezy/1302241 to your computer and use it in GitHub Desktop.
Save cheezy/1302241 to your computer and use it in GitHub Desktop.
Method from Mixology
protected static void clearCache(RubyModule klass, RubyModule module) {
List<String> methodNames = new ArrayList<String>(module.getMethods().keySet());
for (Iterator iter = methodNames.iterator(); iter.hasNext();) {
String methodName = (String) iter.next();
klass.getRuntime().getCacheMap().remove(klass.searchMethod(methodName));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment