{"id":19030173,"url":"https://github.com/typesend/prototype","last_synced_at":"2026-03-16T21:36:57.532Z","repository":{"id":256487580,"uuid":"855444337","full_name":"typesend/prototype","owner":"typesend","description":"An Elixir library that implements prototype inheritance for dynamic function calling","archived":false,"fork":false,"pushed_at":"2024-09-11T23:44:46.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T06:36:31.418Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/typesend.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-10T21:58:49.000Z","updated_at":"2024-09-11T23:44:49.000Z","dependencies_parsed_at":"2024-09-11T03:27:33.083Z","dependency_job_id":"fea63be0-45f8-4b73-a4e0-7101a3bd272b","html_url":"https://github.com/typesend/prototype","commit_stats":null,"previous_names":["typesend/prototype"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typesend%2Fprototype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typesend%2Fprototype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typesend%2Fprototype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typesend%2Fprototype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typesend","download_url":"https://codeload.github.com/typesend/prototype/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249341824,"owners_count":21254193,"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","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":[],"created_at":"2024-11-08T21:16:47.684Z","updated_at":"2025-12-28T21:33:35.518Z","avatar_url":"https://github.com/typesend.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prototype\n\nAn Elixir library that implements prototype inheritance for dynamic function calling\nover a chain of modules. These prototypes can be user-defined struct modules\nor any other modules.\n\n## Usage\n\nTo specify a module's prototype module, implement the `__prototype__/0` function like so:\n\n```Elixir\ndefmodule YourModule do\n  def __prototype__, do: AnyOtherModule\nend\n```\n\nThen to call functions wherever they are found up the prototype chain\nyou might:\n\n```Elixir\ncase Prototype.apply(YourModule, :function_name, [\"argument\", \"list\"]) do\n  {:ok, return_value, _meta} -\u003e return_value,\n  {:missing_fun, _function_name, _args, _meta} -\u003e {:error, \"function not found\"}\nend\n```\n\nWhere `_meta` contains tracing metadata about the call chain that executed.\nAs you might suspect, if the function cannot be found in any of the modules\nthen the result is a :missing_fun tuple because it's not very fun to have\nmultiple attempts to call a function fail!\n\n## Installation\n\nThis package can be installed by adding `prototype` to\nyour list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:prototype, \"~\u003e 1.0.0-alpha\"}\n  ]\nend\n```\n\n## Feedback welcome!\n\nIf you use this library and have suggestions for how to make it better,\nplease [file an issue](https://github.com/typesend/prototype/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypesend%2Fprototype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypesend%2Fprototype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypesend%2Fprototype/lists"}