Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 1.17 KB

README.md

File metadata and controls

44 lines (34 loc) · 1.17 KB

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