What does @derive means?

I saw the code @derive {Jason.Encoder, only: [:name, :phonenum]} and can’t understand what @derive does.
I searched the documents but can’t understand either…
Is it inheriting something?

Hey @menw you can read more about it here Protocols - The Elixir programming language

2 Likes

And for completeness, we list all builtin module attributes in the module page: Module — Elixir v1.14.0 - so a good place to visit whenever you have questions about them!

5 Likes