I wonder how one can list all methods in a module, but not including inherited methods.
eg.
module Software
def exit
puts "exited"
end
end
puts Software.methods
Will list not only exit, but all inherited methods.
Is is possible to just list exit?
Thanks
Actually
Software.methodswill not listexit.Software.instance_methodswill listexitas well as any inherited methods (which in this case is nothing because modules don’t inherit any methods unless you include another module).Software.instance_methods(false)will only list methods defined inSoftware.