The Swrve Ruby Gem

Coverage Status Build Status Code Climate Gem Version

A Ruby interface to the Swrve AB Testing API.

Installation

gem install swrve

Quick Start Guide

Once your account is set up at Swrve.com use the following to configure Swrve

Swrve.configure do |config|
  config.api_key = YOUR_API_KEY
  config.game_id = YOUR_GAME_ID
end

Events

Swrve.session_start('user uuid')
Swrve.create_event('user uuid', "custom.event.name.that.occurred")
Swrve.purchase('user uuid', 'Item Id', 5)
...
...
Swrve.session_end('user uuid')

Resources

json_resource = Swrve.resource('user uuid', "ab_test_name")

Documentation

http://rdoc.info/gems/swrve