Module: VisualizeHelper

Defined in:
lib/visualize_helper/version.rb,
ext/visualize_helper/visualize_helper.c

Constant Summary collapse

VERSION =
"0.0.10.26"

Class Method Summary collapse

Class Method Details

.hello_worldObject

Hello World without parameters



4
5
6
7
# File 'ext/visualize_helper/visualize_helper.c', line 4

static VALUE hello_world()
{
    return rb_str_new_cstr("hello world");
}

.min_max_period(min, max, hash, intervals, aggr) ⇒ Object

Return: [ min, max, period]



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'ext/visualize_helper/visualize_helper.c', line 83

static VALUE min_max_period(VALUE self, VALUE min, VALUE max, VALUE hash, VALUE intervals, VALUE aggr)
{
    int  period = Qnil;

    // Create Ruby array that will be the result
    VALUE array  = rb_ary_new();

    // Push initial values of the result
    rb_ary_push(array,min);  
    rb_ary_push(array,max);  
    rb_ary_push(array,period);  
    rb_ary_push(array,intervals);  
    rb_ary_push(array,aggr);  
    
    
    // iterate on hash calling "encontra_min_max_period" for each
    rb_hash_foreach(hash,encontra_min_max_period,array);
      
    // flatten on aggr
    

    // Return results
    return aggr;
}

.test(param) ⇒ Object

Register the method for development testing



110
111
112
113
114
# File 'ext/visualize_helper/visualize_helper.c', line 110

static VALUE test(VALUE self, VALUE param){

  int a =  INT2FIX(param);
  return FIX2INT(a);
}