There are several double underscore functions, such as __before_compile__ , that automatically call compile time in Elixir. However, I also see several __functions__ double underscores that seem to be called without magic requirements. For example, in Ecto, the following functions are called
Ecto.Schema.__source__(source), Ecto.Schema.__fields__(fields), Ecto.Schema.__assocs__(assocs), Ecto.Schema.__primary_key__(primary_key_field),
What qualifies these __functions__ to have, well, double underscores?
ps: renamed "methods" to "functions" after jose's response. The method is the term oop and is inappropriate here.
elixir
shankardevy
source share