A Mongoid persistence layer for your A/B tests that use the Split Ruby gem.
Add this line to your application's Gemfile:
gem 'split-mongoid'
And then execute:
$ bundle
Or install it yourself as:
$ gem install split-mongoid
Include in the Mongoid classes that will use the a/b tests:
class User
include Mongoid::Document
include Split::Mongoid
end
Then, run your a/b tests:
user = User.new
user.ab_test("favorite_superhero", "Superman", "Spiderman") do |hero|
puts hero
end
Then, when finished, run:
user.finished("favorite_superhero")
Reporting works exactly the same as the Split gem.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request