all files / sparql/ result.js

100% Statements 13/13
100% Branches 6/6
100% Functions 2/2
100% Lines 7/7
1 statement, 1 branch Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21                             
'use strict';
 
export default class Result {
    /**
     * The Result class wraps the possible responses from the SPARQL endpoint's response
     *
     * @class Result
     * @constructor
     * @param {String} data - Result object
     */
    constructor(data) {
        if (data.results) {
            this.bindings = data.results.bindings;
            this.vars = data.head.vars;
            this.link = data.head.link;
        }
        if (data.boolean) {
            this.boolean = data.boolean;
        }
    }
}