Project

giocopro

0.0
No commit activity in last 3 years
No release in over 3 years
Gioco Pro gem is the SDK of Gioco Pro service a easy way to implement gamification based on plug and play concept. Doesn't matter if you already have a full and functional database, Gioco will smoothly integrate everything and provide all methods and analytics that you might need.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Alt text

Gioco Pro (current version - 0.0.9)

Gioco Pro gem is the SDK of Gioco Pro service for Rails Applications. A easy way to implement gamification based on plug and play concept. Doesn't matter if you already have a full and functional database, Gioco will smoothly integrate everything and provide all methods and analytics that you might need.

Installation

Gioco Pro is available through Rubygems and can be installed by:

adding it in Gemfile:

gem 'giocopro'

and running the bundler:

$ bundle install

Setup

To setup Gioco with your application:

rails g giocopro:setup --secret [YOUR_SECRET_KEY_HERE]

Replace [YOUR_SECRET_KEY_HERE] for you token. It can be found HERE on Manage > Application Token.

Next, you will be prompted to provide your Resource Model. This is generally the User model.

Usage

Gioco will bind some method to your Resource Model, it will enable you to easily retrieve and track your users data inside your application.

Resource

Get User data

gioco_data

Examples:

current_user.gioco_data
 # RESPONSE:
  {
    "aid" => 25,
    "badges" => [],
    "level" => nil,
    "new_stats" => nil, # Array of the implementations that the resource just received
    "points" => 0
  }

Events

Tracking Events

track_event (events_name: String)

Examples:

current_user.track_event('Login')
 # RESPONSE:
  {
    "aid" => 25,
    "badges" => [
        "image_url" => "http://image_url.png",
        "name" => "Begginer"
    ],
    "level" => 1,
    "points" => 100,
    "new_stats" => [  # Array of the implementations that the resource just received
        {
          "badge" => {
            "image_url" => "http://image_url.png",
            "name" => "Begginer"
          }
        }
        {
          "point" => {
            "name" => "Test Points",
            "points" => 100
          }
        }
        {
          "level" => {
            "levels" => 1
          }
        }
    ]
  }

Ranking

Retrieve Ranking

ranking (size: Integer(default: 100), batch: Integer(default: 1))

Examples:

current_user.ranking
 # RESPONSE:
  [
    {
      "aid" => 25,
      "badges" => [],
      "level" => nil,
      "new_stats" => nil,
      "points" => 0
    },
    {
      "aid" => 26,
      "badges" => [],
      "level" => nil,
      "new_stats" => nil,
      "points" => 0
    }
  ]

License

Gioco is released under the MIT license.