{"id":16746802,"url":"https://github.com/marcelotto/behaviour_reflection","last_synced_at":"2025-10-10T02:33:44.162Z","repository":{"id":57479557,"uuid":"263190468","full_name":"marcelotto/behaviour_reflection","owner":"marcelotto","description":"Get all modules implementing an Elixir behaviour","archived":false,"fork":false,"pushed_at":"2020-05-12T09:26:57.000Z","size":12,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-19T09:29:24.269Z","etag":null,"topics":["elixir","reflection"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/behaviour_reflection","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcelotto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-12T00:26:01.000Z","updated_at":"2024-04-03T07:09:24.000Z","dependencies_parsed_at":"2022-09-18T05:46:49.974Z","dependency_job_id":null,"html_url":"https://github.com/marcelotto/behaviour_reflection","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/marcelotto/behaviour_reflection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelotto%2Fbehaviour_reflection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelotto%2Fbehaviour_reflection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelotto%2Fbehaviour_reflection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelotto%2Fbehaviour_reflection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcelotto","download_url":"https://codeload.github.com/marcelotto/behaviour_reflection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelotto%2Fbehaviour_reflection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271751908,"owners_count":24814705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","reflection"],"created_at":"2024-10-13T02:08:23.502Z","updated_at":"2025-10-10T02:33:39.141Z","avatar_url":"https://github.com/marcelotto.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Behaviour.Reflection\n\n[![Travis](https://img.shields.io/travis/marcelotto/behaviour_reflection.svg?style=flat-square)](https://travis-ci.org/marcelotto/behaviour_reflection)\n[![Hex.pm](https://img.shields.io/hexpm/v/behaviour_reflection.svg?style=flat-square)](https://hex.pm/packages/behaviour_reflection)\n\n\nGet all modules implementing an Elixir behaviour.\n\nSee [this article](https://medium.com/@MarcelOttoDE/the-walled-gardens-within-elixir-d0507a568015) for an analysis of the problem, the circumstances for when to use this library, how it works and its caveats.\n\n\n## Installation\n\nThe Hex package can be installed as usual, by adding `behaviour_reflection` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:behaviour_reflection, \"~\u003e 0.1\"}\n  ]\nend\n```\n\n\n## Usage\n\nLet's say you have a behaviour and a number of modules implementing it:\n\n```elixir\ndefmodule MyBehaviour do\n  @callback fun :: String.t\nend\n\ndefmodule Foo do\n  @behaviour MyBehaviour\n  def fun(), do: \"foo\"\nend\n\ndefmodule Bar do\n  @behaviour MyBehaviour\n  def fun(), do: \"bar\"\nend\n```\n\nAt runtime you can retrieve all modules implementing the behaviour like this:\n\n```elixir\niex\u003e Behaviour.Reflection.impls(MyBehaviour)\n[Foo, Bar]\n```\n\nDocumentation can be found at [https://hexdocs.pm/behaviour_reflection](https://hexdocs.pm/behaviour_reflection).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelotto%2Fbehaviour_reflection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelotto%2Fbehaviour_reflection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelotto%2Fbehaviour_reflection/lists"}