https://github.com/tfwright/mr_badger
Achievement tracker for Elixir apps
https://github.com/tfwright/mr_badger
badges gamification hacktoberfest
Last synced: 4 months ago
JSON representation
Achievement tracker for Elixir apps
- Host: GitHub
- URL: https://github.com/tfwright/mr_badger
- Owner: tfwright
- License: mit
- Created: 2019-09-15T16:13:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-15T17:32:10.000Z (almost 7 years ago)
- Last Synced: 2025-10-31T22:15:45.785Z (8 months ago)
- Topics: badges, gamification, hacktoberfest
- Language: Elixir
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MrBadger
[](https://circleci.com/gh/tfwright/mr_badger)
**Achievement tracking for Elixir apps**
## Installation
The package can be installed by adding `mr_badger` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:mr_badger, "~> 0.1.0"}
]
end
```
## Usage
```elixir
defmodule MyBadges do
use MrBadger
award(:my_first_badge, {user, :action}) do
user.done_action?
end
end
MyBadges.badges_earned({user, :action})
# => [:my_first_badge]
MyBadges.earns_my_first_badge?({user, :action})
# => true
MyBadges.earns_my_first_badge?({user, :another_action})
# => false
```
Docs can be found at [https://hexdocs.pm/mr_badger](https://hexdocs.pm/mr_badger).