Rails engine in form of gem for including gamification into your Rails app. Game admin creates game(s), add metrics, actions, players and teams to them. Than any player can play an action and get rewards to his/her scores. And of course any player can display leaderboards for any metric (for players or teams).
Typical usage will be
- instal gem
- add
config/initializers/gamfora.rb
with content
Gamfora.game_owner_class = "User"
Gamfora.game_owner_name_attribute = "username"
Gamfora.player_class = "User"
Gamfora.player_name_attribute = "name"
- use
game=Gamfora::Game.find_by_name("my_game")
game.play_action(:issue_commented, current_user)
game.player_for(current_user).scores
game.player_leaderboards.find(:tolar_metrics)
Add this line to your application's Gemfile:
gem 'gamfora'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gamfora
Contribution directions go here.
The gem is available as open source under the terms of the MIT License.