Ruby Client for Xperiments¶ ↑
Ruby client for A/B tool Xperiments. Based on {Patron}[https://github.com/toland/patron].
It is used to show the experiments during the page load.
Usage¶ ↑
Add gem 'xp_ruby_client'
to your Gemfile.
You must to add XP_RUBY_CLIENT_HOST
variable into your environment.
To use it, first you need to configure some settings:
- application
is required. - timeout
, optional, default: 100 (ms) - segments
, optional, can be set as an arguemnt on a request, default: {} - assigned
, optional, can be set as an arguemnt on a request, default: []
Configurations:
experiment = XpRubyClient.experiment do |config| config.application = "web" config.timeout = 50 end
And retrieve an experiment:
experiment.retrieve # by default won't be used any segments # OR experiment.retrieve(segments: {lang: "en"})
Copyright¶ ↑
Copyright © 2017 WeTransfer, Dmitry Tymchuk. See LICENSE.txt for further details.