UNPKG

spahql

Version:

A query language and data model for deep Javascript object structures.

191 lines (126 loc) 10.2 kB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>SpahQL v0.7.0 API documentation | SpahQL.QueryRunner.evalAssertion</title> <meta name="generator" content="PDoc" /> <script charset="utf-8" src="../../../javascripts/pdoc/prototype.js" type="text/javascript"></script> <script charset="utf-8" src="../../../javascripts/pdoc/application.js" type="text/javascript"></script> <script charset="utf-8" src="../../../javascripts/pdoc/tabs.js" type="text/javascript"></script> <script charset="utf-8" src="../../../javascripts/pdoc/item_index.js" type="text/javascript"></script> <link charset="utf-8" href="../../../stylesheets/pdoc/api.css" media="screen, projection" rel="stylesheet" type="text/css" /> <link charset="utf-8" href="../../../stylesheets/pdoc/pygments.css" media="screen, projection" rel="stylesheet" type="text/css" /> <script type="text/javascript"> PDoc.pathPrefix = '../../../'; </script> </head> <body> <div id="sidebar"> <ul id="sidebar_tabs" class="sidebar-tabs"> <li> <a href="#menu_pane">Menu</a> </li> <li> <a href="#search_pane">Search</a> </li> </ul> <!-- .sidebar-tabs --> <form class="search-ribbon"> <label> <span class="hidden">Search</span> <input type="text" id="search" size="20" title="Search" /> </label> </form> <div class="sidebar-pane scrollable" id="menu_pane"> <ul class="menu-items" id="api_menu"><li><div class="menu-item"><a class="class current-parent" href="../../../SpahQL/index.html" title="SpahQL (class)">SpahQL</a></div><ul><li><div class="menu-item"><a class="class" href="../../../SpahQL/Callbacks/index.html" title="SpahQL.Callbacks (class)">SpahQL.Callbacks</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/DataHelper/index.html" title="SpahQL.DataHelper (class)">SpahQL.DataHelper</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Errors/index.html" title="SpahQL.Errors (class)">SpahQL.Errors</a></div><ul><li><div class="menu-item"><a class="class" href="../../../SpahQL/Errors/SpahQLError/index.html" title="SpahQL.Errors.SpahQLError (class)">SpahQL.Errors.SpahQLError</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Errors/SpahQLRunTimeError/index.html" title="SpahQL.Errors.SpahQLRunTimeError (class)">SpahQL.Errors.SpahQLRunTimeError</a></div></li></ul></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Query/index.html" title="SpahQL.Query (class)">SpahQL.Query</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/QueryParser/index.html" title="SpahQL.QueryParser (class)">SpahQL.QueryParser</a></div></li> <li><div class="menu-item"><a class="class current-parent" href="../../../SpahQL/QueryRunner/index.html" title="SpahQL.QueryRunner (class)">SpahQL.QueryRunner</a></div><ul><li><div class="menu-item"><a class="class-method" href="../../../SpahQL/QueryRunner/assert/index.html" title="SpahQL.QueryRunner.assert (class method)">assert</a></div></li> <li><div class="menu-item"><a class="class-method current" href="../../../SpahQL/QueryRunner/evalAssertion/index.html" title="SpahQL.QueryRunner.evalAssertion (class method)">evalAssertion</a></div></li> <li><div class="menu-item"><a class="class-method" href="../../../SpahQL/QueryRunner/select/index.html" title="SpahQL.QueryRunner.select (class method)">select</a></div></li></ul></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Strategiser/index.html" title="SpahQL.Strategiser (class)">SpahQL.Strategiser</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Token/index.html" title="SpahQL.Token (class)">SpahQL.Token</a></div><ul><li><div class="menu-item"><a class="class" href="../../../SpahQL/Token/Base/index.html" title="SpahQL.Token.Base (class)">SpahQL.Token.Base</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Token/Boolean/index.html" title="SpahQL.Token.Boolean (class)">SpahQL.Token.Boolean</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Token/ComparisonOperator/index.html" title="SpahQL.Token.ComparisonOperator (class)">SpahQL.Token.ComparisonOperator</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Token/FilterQuery/index.html" title="SpahQL.Token.FilterQuery (class)">SpahQL.Token.FilterQuery</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Token/KeyName/index.html" title="SpahQL.Token.KeyName (class)">SpahQL.Token.KeyName</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Token/Numeric/index.html" title="SpahQL.Token.Numeric (class)">SpahQL.Token.Numeric</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Token/PathComponent/index.html" title="SpahQL.Token.PathComponent (class)">SpahQL.Token.PathComponent</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Token/SelectionQuery/index.html" title="SpahQL.Token.SelectionQuery (class)">SpahQL.Token.SelectionQuery</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Token/Set/index.html" title="SpahQL.Token.Set (class)">SpahQL.Token.Set</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Token/Simple/index.html" title="SpahQL.Token.Simple (class)">SpahQL.Token.Simple</a></div></li> <li><div class="menu-item"><a class="class" href="../../../SpahQL/Token/String/index.html" title="SpahQL.Token.String (class)">SpahQL.Token.String</a></div></li></ul></li></ul></li></ul><!--- #api_menu =--> </div> <!-- .sidebar-pane --> <div class="sidebar-pane" id="search_pane"> <ul id="search_results" class="search-results menu-items scrollable"></ul> </div> <!-- .sidebar-pane --> </div> <!-- #sidebar --> <div id="page"> <div id="main" class="page-content"> <ul class="breadcrumbs clearfix"> <li><a href="../../../">Home</a></li> <li>&rarr; <a href="../../../SpahQL/index.html" title="SpahQL (class)">SpahQL</a></li> <li>&rarr; <a href="../../../SpahQL/QueryRunner/index.html" title="SpahQL.QueryRunner (class)">QueryRunner</a></li> <li>&rarr; <a href="../../../SpahQL/QueryRunner/evalAssertion/index.html" title="SpahQL.QueryRunner.evalAssertion (class method)">evalAssertion</a></li> </ul> <p id="src_code_href"><a href="http://github.com/danski/spahql/blob/master/src/SpahQL.QueryRunner.js#59">src code</a></p> <h2 class="page-title"> <span class="type">class method</span> SpahQL.QueryRunner.evalAssertion </h2> <div class="section"> <div class="section-title"> </div> <!-- .section-title --> <div class="section-content"> <div class="method-description"> <pre class="syntax"><code class="ebnf">SpahQL.QueryRunner.evalAssertion(primaryToken, secondaryToken, comparisonOperator, rootData, scopeData, scopePath) &rarr; Boolean result</code></pre> <ul class="argument-list"> <li> <code class="argument-name">primaryToken</code> <span class="argument-types">(<code>Object</code>)</span> &ndash; A selection query or set literal token as delivered by the query parser. </li> <li> <code class="argument-name">secondaryToken</code> <span class="argument-types">(<code>Object</code>)</span> &ndash; A selection query or set literal token as delivered by the query parser. May be null. </li> <li> <code class="argument-name">comparisonOperator</code> <span class="argument-types">(<code>String</code>)</span> &ndash; The comparison operator that will be used to compare the primary and secondary result sets. </li> <li> <code class="argument-name">rootData</code> <span class="argument-types">(<code>Object</code>)</span> &ndash; A root data context for any selection queries that appear in the literal </li> <li> <code class="argument-name">scopeData</code> <span class="argument-types">(<code>Object</code>)</span> &ndash; A scoped data context for the scope at which selection queries in the set will be evaluated. </li> <li> <code class="argument-name">scopePath</code> <span class="argument-types">(<code>String</code>)</span> &ndash; An optional path indicating the scope to which this query has been restricted. </li> </ul> <!-- .argument-list --> <p>Executes an assertion query. If the secondary token is null, then the primary token will be evaluated and the assertion will be successful (returning true) if the primary resultset contains one or more &#8220;truthy&#8221; values (i.e. if it is not simply full of nulls and/or false values). If the secondary token is provided, then the two tokens will be evaluated and their result sets compared using the provided operator.</p> </div> </div> <!-- .section-content --> </div> <!-- .section --> </div> <!-- #main --> <div id="footer"> <p><a href="http://danski.github.com/spahql">SpahQL</a> v0.7.0 API documentation.</p> <p> Last updated on May 19, 2012 at 14:16 UTC. Generated by <a href="http://pdoc.org">PDoc</a>. Uses <a href="http://famfamfam.com/lab/icons/silk/" title="famfamfam.com: Silk Icons">Silk Icons</a> and portions of <a href="http://github.com/280north/aristo/tree/master" title="280north's aristo at master - GitHub">Aristo</a>. </p> </div> <!-- #footer --> </div> <!-- #page --> </body> </html>