{"id":17119507,"url":"https://github.com/koudelka/behaves_like","last_synced_at":"2025-04-13T04:41:21.448Z","repository":{"id":57479539,"uuid":"135760984","full_name":"koudelka/behaves_like","owner":"koudelka","description":"Instant Elixir behaviours, creates callbacks from specs.","archived":false,"fork":false,"pushed_at":"2018-11-06T21:52:39.000Z","size":21,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T11:40:59.594Z","etag":null,"topics":["behaviour","elixir"],"latest_commit_sha":null,"homepage":"","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/koudelka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-01T20:34:20.000Z","updated_at":"2023-09-06T17:45:06.000Z","dependencies_parsed_at":"2022-09-18T05:46:21.203Z","dependency_job_id":null,"html_url":"https://github.com/koudelka/behaves_like","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koudelka%2Fbehaves_like","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koudelka%2Fbehaves_like/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koudelka%2Fbehaves_like/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koudelka%2Fbehaves_like/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koudelka","download_url":"https://codeload.github.com/koudelka/behaves_like/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665782,"owners_count":21142122,"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":["behaviour","elixir"],"created_at":"2024-10-14T17:57:21.897Z","updated_at":"2025-04-13T04:41:21.427Z","avatar_url":"https://github.com/koudelka.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BehavesLike\n\n[![Build Status](https://travis-ci.org/koudelka/behaves_like.svg?branch=master)](https://travis-ci.org/koudelka/behaves_like)\n[![Hex pm](https://img.shields.io/hexpm/v/behaves_like.svg?style=flat)](https://hex.pm/packages/behaves_like)\n\nTurns a module's specs into callbacks.\n\nLets you state that a module behaves like another, without writing behaviour callbacks.\n\nUses a macro for 1.7, until https://github.com/elixir-lang/elixir/issues/8085 is fixed.\n\nFor example:\n```elixir\ndefmodule API do\n  use BehavesLike\n  import BehavesLike, only: [spec_and_callback: 1]\n\n  spec_and_callback get(binary()) :: {:ok, any()} | {:error, any()}\n  def get(id) do\n    Backend.get(id)\n  end\nend\n\ndefmodule Backend do\n  @behaviour API\n\n  @impl true\n  def get(id) do\n    database().get(id)\n  end\nend\n```\n\n## Installation\n\nFrom Hex:\n\n```elixir\ndef deps do\n  [\n    {:behaves_like, \"~\u003e 0.5.0\"}\n  ]\nend\n```\n\n## Usage\n\nImport the required macro, then declare your specs with `spec_and_callback/1`, as in the example above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoudelka%2Fbehaves_like","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoudelka%2Fbehaves_like","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoudelka%2Fbehaves_like/lists"}