Skip to content

Instantly share code, notes, and snippets.

/////////////////////////////////////
// In the promotion rule application:
rule = new Rule();
rule.callbacks.get_condition_options = function(type, property, operator, value) {
// Make AJAX call to services:
// GET /promos/rules/options?type=type&property=property&operator=operator&value=value
// Parse the server response into whatever return format is expected of this type of
// callback function (as defined by the general purpose rule system)
require 'rubygems'
require 'pp'
# -------
cond1 = {
:type => 'transaction_field',
:params => {
:field => 'store_id',
:operator => 'equals',
:value => 9
require 'ruby-processing'
class Radiohead < Processing::App
load_libraries :opengl, :video
include_package "processing.opengl"
include_package "processing.video"
def setup
render_mode OPENGL