Hey,
is it possible to find out which module functions have specific module attributes?
defmodule MyModule do
@attr_1
def my_func_1() do
end
@attr_1
def my_func_2() do
end
@attr_2
def my_func_3() do
end
@attr_2
def my_func_4() do
end
@attr_3 "foo"
def my_func_5() do
end
@attr_3 "bar"
def my_func_6() do
end
end
The above example module has 6 functions. Two of them have @attr_1
, another two have @attr_2
and the last two functions have @attr_3
but each of them got a unique value.
Now I want to know all functions with the @attr_2
module attribute, or all functions with @attr_3 "foo"
. Is there something inside Elixir that I could use for that? @doc
and @spec
kinda work the same, at least the language knows that they belong to a certain function definition.