package toast.examples;

import jaci.openrio.toast.core.loader.groovy.GroovyPreferences;

public class Configuration {

    GroovyPreferences preferences;

    public void register() {                // This would be called from your Main module
        preferences = new GroovyPreferences("my_module_name");
        int my_int = preferences.getInt("my_int", 0, "A standard integer for the module");
        String my_str = preferences.getString("my_str", "Hello World", "A standard string for the module");

        int nested_int = preferences.getInt("nested.my_int", 1, "An integer nested inside of 'nested'");
    }

}

@@ -48,44 +48,31 @@
 ast.
-core.loader.groovy.GroovyPreferences
+lib.module.ModuleConfig
 ;%0A%0Ap
@@ -104,33 +104,28 @@
  %7B%0A%0A    
-GroovyPreferences
+ModuleConfig
  prefere
@@ -251,25 +251,20 @@
 new 
-GroovyPreferences
+ModuleConfig
 (%22my
@@ -334,45 +334,8 @@
 %22, 0
-, %22A standard integer for the module%22
 );%0A 
@@ -406,44 +406,8 @@
 rld%22
-, %22A standard string for the module%22
 );%0A%0A
@@ -472,48 +472,8 @@
 %22, 1
-, %22An integer nested inside of 'nested'%22
 );%0A 

Update config example