I’ve always wanted Structs to be opaque by default.
So I built Objext which allows user to define opaque data structures.
For an “objext”, only the module that defines it can access its internal state, the other modules can only access these states via public functions.
Objext also provides macros to:
- define Protocol-like interfaces for “Objexts”.
- create mocks for testing purpose
Check it out and give it a try: https://github.com/dsdshcym/objext
Read next Senior Elixir Engineer at MEDWING