Last active
December 26, 2015 09:09
-
-
Save amiel/7127338 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ABTestHelper | |
def test | |
yield | |
end | |
def variant(variant) | |
if variant_matches(variant) | |
yield | |
end | |
end | |
def control | |
variant(nil) | |
end | |
private | |
def variant_matches(variant) | |
params[:variant] == variant | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment