<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Source: flags.js</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Source: flags.js</h1>

    



    
    <section>
        <article>
            <pre class="prettyprint source linenums"><code>/**
 * just.js extension package
 *
 * @author danikas2k2 (danikas2k2@gmail.com)
 */
"use strict";

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i &lt; props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

require("./global");

module.exports = (function () {
    var Flags = (function () {

        /**
         *
         * @param flag {number|Flags}
         * @return {Flags}
         * @constructor
         */

        function Flags(flag) {
            _classCallCheck(this, Flags);

            this.reset(flag);
        }

        _createClass(Flags, [{
            key: "valueOf",

            /**
             *
             * @return {number}
             */
            value: function valueOf() {
                return this.flags;
            }
        }, {
            key: "toString",

            /**
             *
             * @return {string}
             */
            value: function toString() {
                return this.flags.toString();
            }
        }, {
            key: "is",

            /**
             *
             * @param flag {number|Flags}
             * @return {boolean}
             */
            value: function is(flag) {
                return (this.flags &amp; flag) == flag;
            }
        }, {
            key: "set",

            /**
             *
             * @param flag {number|Flags}
             * @return {Flags}
             */
            value: function set(flag) {
                this.flags = this.flags | flag;
                return this;
            }
        }, {
            key: "unset",

            /**
             *
             * @param flag {number|Flags}
             * @return {Flags}
             */
            value: function unset(flag) {
                this.flags = this.flags &amp; ~flag;
                return this;
            }
        }, {
            key: "reset",

            /**
             *
             * @param flag {number|Flags}
             * @return {Flags}
             */
            value: function reset(flag) {
                this.flags = isNaN(flag) ? 0 : +flag;
                return this;
            }
        }]);

        return Flags;
    })();

    return globalScope().Flags = Flags;
})();
</code></pre>
        </article>
    </section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#value">value</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.2</a> on Thu Jul 09 2015 00:27:28 GMT+0300 (EEST)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
