Give me the module:
defmodule Foo do
def bar(baz) do
IO.puts baz
end
end
Is there a way I can return:
def bar(baz) do
IO.puts baz
end
I developed that I can download the full module definition using
Foo.__info__(:compile) |> List.last |> elem(1) |> File.read |> elem(1)
But ideally, I would like to do something like
Foo.bar/1.__definition__
#=> def bar(baz) do\n IO.puts baz\nend\d
source
share