I'm trying to get a list of the methods defined in our Rails codebase, without including anything defined in superclass or dynamically defined at runtime. I've tried instance_methods(false), but a ton of methods are returned:
> User.instance_methods(false).length
=> 310
I'm guessing this is because Rails defines a bunch of methods at runtime. Is there any way to get a list of the methods only defined in the files in our app? Hoping there's a Ruby way and not just running a grep across all of the files. Bonus points for class methods as well...
User.methods.sort - ActiveRecord::Base.methods(User.instance_methods(false) - ActiveRecord::Base.instance_methods(false)).size # => 310