UNPKG

jsdoc-oblivion

Version:
924 lines (385 loc) 15.2 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=yes, width=device-width"> <title>Oblivion — Class: base</title> <link rel="shortcut icon" href="/favicon.ico"> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/sunlight.dark.css"> <link type="text/css" rel="stylesheet" href="styles/site.oblivion.css"> </head> <body> <div class="container-fluid"> <div class="navbar navbar-fixed-top navbar-inverse"> <div class="navbar-inner"> <a class="brand" href="index.html">Oblivion</a> <ul class="nav"> <li class="dropdown"> <a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="module-base.html">base</a> </li> <li> <a href="module-base_chains.html">base/chains</a> </li> <li> <a href="module-documents_binder.html">documents/binder</a> </li> <li> <a href="module-documents_model.html">documents/model</a> </li> <li> <a href="module-documents_probe.html">documents/probe</a> </li> <li> <a href="module-documents_schema.html">documents/schema</a> </li> <li> <a href="module-ink_collector.html">ink/collector</a> </li> <li> <a href="module-mixins_bussable.html">mixins/bussable</a> </li> <li> <a href="module-mixins_signalable.html">mixins/signalable</a> </li> <li> <a href="module-strings_format.html">strings/format</a> </li> <li> <a href="module-utils_logger.html">utils/logger</a> </li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="base.html">base</a> </li> <li> <a href="base_chains.html">base/chains</a> </li> <li> <a href="documents_model.html">documents/model</a> </li> <li> <a href="module-documents_probe.queryOperators.html">documents/probe.queryOperators</a> </li> <li> <a href="module-documents_probe.updateOperators.html">documents/probe.updateOperators</a> </li> <li> <a href="module-ink_collector-ACollector.html">ink/collector~ACollector</a> </li> <li> <a href="module-ink_collector-CollectorBase.html">ink/collector~CollectorBase</a> </li> <li> <a href="module-ink_collector-OCollector.html">ink/collector~OCollector</a> </li> <li> <a href="module-mixins_signalable-Signal.html">mixins/signalable~Signal</a> </li> <li> <a href="utils_logger.Logger.html">utils/logger.Logger</a> </li> </ul> </li> <li class="dropdown"> <a href="mixins.list.html" class="dropdown-toggle" data-toggle="dropdown">Mixins<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="documents_schema.html">documents/schema</a> </li> <li> <a href="mixins_bussable.html">mixins/bussable</a> </li> <li> <a href="mixins_signalable.html">mixins/signalable</a> </li> </ul> </li> </ul> </div> </div> <div class="row-fluid"> <div class="span3"> <div id="toc"></div> </div> <div class="span9"> <div id="main"> <h1 class="page-title">Class: base</h1> <section> <header> <h2> base </h2> <div class="class-description">The base of all classes in the system, this is one of the few pure "classes" in core the of the system. It is a pretty clean little class whose primary purpose is to surface the composition chains and a basis for storing options on mixin and subclass instances. Options are handled at the instance rather than the prototype level so that multiple instances don't compete for default values.</div> </header> <article> <div class="container-overview"> <dt> <h4 class="name" id="base"><span class="type-signature"></span>new base<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> </dl> </dd> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="base_chains.html">base/chains</a></li> </ul> <h3 class="subsection-title">Members</h3> <dl> <dt class="name" id="close"> <h4><span class="type-signature"></span>close<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> The `close` method asks an object to shut itself down in a way that will allow it to be reopened, unlike the <a href="base_chains.html#end">end method</a> which will call the destroy method which should make the object unusable, but also devoid of all resources whereas `close` may still keep some resources open. This uses the `before` chain which means the last one defined in the first one destroyed </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="base_chains.html#close">base/chains#close</a> </li> </ul> </dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="base_chains.html#open">base/chains#open</a></li> </ul> </dd> </dl> </dd> <dt class="name" id="open"> <h4><span class="type-signature"></span>open<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> If you are using the open/close paradigm for an object that can kind of go dormant on <a href="base_chains.html#close">base/chains#close</a> and can be "reopened" again later, here is where the "open" code will go. This used the `after` chain which means that the first one defined is the first one destroyed. </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="base_chains.html#open">base/chains#open</a> </li> </ul> </dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="base_chains.html#close">base/chains#close</a></li> </ul> </dd> </dl> </dd> </dl> <h3 class="subsection-title">Methods</h3> <dl> <dt> <h4 class="name" id="addDefaultOptions"><span class="type-signature"></span>addDefaultOptions<span class="signature">(options)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> Add a default option to a class. The default options are only set if there is not already a value for the option. </div> <h5>Parameters:</h5> <div class="params-table-container"> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">hash</span> </td> <td class="description last">A hash of options you want to set</td> </tr> </tbody> </table> </div> <dl class="details"> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li>{<a href="base.html#addOptions">base#addOptions</a>}</li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="addOptions"><span class="type-signature"></span>addOptions<span class="signature">(options)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> Add an option to a class. If any members of the hash already exist in `this.options`, they will be overwritten. </div> <h5>Parameters:</h5> <div class="params-table-container"> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">hash</span> </td> <td class="description last">A hash of options you want to set</td> </tr> </tbody> </table> </div> <dl class="details"> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li>{<a href="base.html#addDefaultOptions">base#addDefaultOptions</a>}</li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> Called when it is time to get rid of all of your instance level references and objects and events. You can define this method on your own classes without having to call the superclass instance. It is called by `instance.end()` automatically </div> <dl class="details"> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li>{<a href="base_chains.html#end">base/chains#end</a>}</li> <li>{base/chains#destroy}</li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="end"><span class="type-signature"></span>end<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> Call this to close your object and dispose of all maintained resources. You can define this method on your own classes without having to call the superclass instance, however it is reccomended that you put all disposal code in `destroy()`. You must be disciplined about calling this on your instances. </div> <dl class="details"> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li>{<a href="base_chains.html#end">base/chains#end</a>}</li> <li>{base/chains#destroy}</li> </ul> </dd> </dl> </dd> </dl> </article> </section> </div> <div class="clearfix"></div> <footer> <span class="copyright"> Copyright © 2014 <a href='http://moogs.io' target='_blank'>Moogs, LLC.</a> </span> <br /> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc" target="_blank">JSDoc 3.4.3</a> on 2017-07-16T00:18:22-07:00 </span> </footer> </div> <br clear="both"> </div> </div> <!--<script src="scripts/sunlight.js"></script>--> <script src="scripts/docstrap.lib.js"></script> <script src="scripts/bootstrap-dropdown.js"></script> <script src="scripts/toc.js"></script> <script> $( function () { $( "[id*='$']" ).each( function () { var $this = $( this ); $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) ); } ); $( "#toc" ).toc( { anchorName : function ( i, heading, prefix ) { return $( heading ).attr( "id" ) || ( prefix + i ); }, selectors : "h1,h2,h3,h4", showAndHide : false, scrollTo : "100px" } ); $( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); $( '.dropdown-toggle' ).dropdown(); // $( ".tutorial-section pre, .readme-section pre" ).addClass( "sunlight-highlight-javascript" ).addClass( "linenums" ); $( ".tutorial-section pre, .readme-section pre" ).each( function () { var $this = $( this ); var example = $this.find( "code" ); exampleText = example.html(); var lang = /{@lang (.*?)}/.exec( exampleText ); if ( lang && lang[1] ) { exampleText = exampleText.replace( lang[0], "" ); example.html( exampleText ); lang = lang[1]; } else { lang = "javascript"; } if ( lang ) { $this .addClass( "sunlight-highlight-" + lang ) .addClass( "linenums" ) .html( example.html() ); } } ); Sunlight.highlightAll( { lineNumbers : true, showMenu : true, enableDoclinks : true } ); } ); </script> <!--Navigation and Symbol Display--> <!--Google Analytics--> </body> </html>