Code coverage report for lib/inTraderCurrency.js

Statements: 100% (21 / 21)      Branches: 95.45% (21 / 22)      Functions: 100% (4 / 4)      Lines: 100% (21 / 21)      Ignored: none     

All files » lib/ » inTraderCurrency.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45    1 18       18 514 19   18 17   1         514     18 115 17 16     115     18 11 7 6     11       1 1    
'use strict';
 
function inTraderCurrency() {
    var code = '',
        rate = 0,
        symbol = '';
 
    this.code = function(val) {
        if(val) {
            if(typeof val == 'string' || val instanceof String) {
 
                if(val.length == 3) {
                    code = val.toUpperCase();
                } else {
                    code = val.substring(0,3).toUpperCase();
                }
 
            }
        }
        return code;
    }
 
    this.rate = function(val) {
        if(val) {
            if(typeof val == 'number' || val instanceof Number) {
                rate = val;
            }
        }
        return rate;
    }
 
    this.symbol = function(val) {
        if(val) {
            if(typeof val == 'string' || val instanceof String) {
                symbol = val;
            }
        }
        return symbol;
    }
}
 
Eif (typeof module !== 'undefined') {
    module.exports = inTraderCurrency;
}