var Resource = Class.create({
    REGEX_SYNTAX: /(^|.|\r\n)(::(\w+)::)/,
    initialize: function(options){
        this.options = Object.extend({
            PATH: [],
            CONFIG_LIST: [],
            LIMIT: [],
            CALLBACK: function() {}
        }, options);
        var id = jsonRpcWrapper.fetch({
            method: 'resource.get',
            params: [this.options],
            onSuccess: this._load_data.bind(this),
            onError: function(){console.log('Resource JSON failed to load')}
        });
        return id;
    },
    _load_data: function(jsonRpcResponse){
        var data = jsonRpcResponse.getValue();
        this.keys = $H(data);
        this.options.CALLBACK(this);
        document.fire("resources:loaded");
    }
});

