Current Directory:
/opt/cpanel/ea-ruby24/root/usr/share/gems/doc/sqlite3-1.4.2/rdoc/SQLite3/Database
Upload
Create File
File Name
Size
Actions
FunctionProxy.html
10052 bytes
Edit
|
Delete
|
Rename
|
Download
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>class SQLite3::Database::FunctionProxy - sqlite3-1.4.2 Documentation</title> <script type="text/javascript"> var rdoc_rel_prefix = "../../"; var index_rel_prefix = "../../"; </script> <script src="../../js/navigation.js" defer></script> <script src="../../js/search.js" defer></script> <script src="../../js/search_index.js" defer></script> <script src="../../js/searcher.js" defer></script> <script src="../../js/darkfish.js" defer></script> <link href="../../css/fonts.css" rel="stylesheet"> <link href="../../css/rdoc.css" rel="stylesheet"> <body id="top" role="document" class="class"> <nav role="navigation"> <div id="project-navigation"> <div id="home-section" role="region" title="Quick navigation" class="nav-section"> <h2> <a href="../../index.html" rel="home">Home</a> </h2> <div id="table-of-contents-navigation"> <a href="../../table_of_contents.html#pages">Pages</a> <a href="../../table_of_contents.html#classes">Classes</a> <a href="../../table_of_contents.html#methods">Methods</a> </div> </div> <div id="search-section" role="search" class="project-section initially-hidden"> <form action="#" method="get" accept-charset="utf-8"> <div id="search-field-wrapper"> <input id="search-field" role="combobox" aria-label="Search" aria-autocomplete="list" aria-controls="search-results" type="text" name="search" placeholder="Search" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"> </div> <ul id="search-results" aria-label="Search Results" aria-busy="false" aria-expanded="false" aria-atomic="false" class="initially-hidden"></ul> </form> </div> </div> <div id="class-metadata"> <div id="parent-class-section" class="nav-section"> <h3>Parent</h3> <p class="link"><a href="../../Object.html">Object</a> </div> <!-- Method Quickref --> <div id="method-list-section" class="nav-section"> <h3>Methods</h3> <ul class="link-list" role="directory"> <li ><a href="#method-c-new">::new</a> <li ><a href="#method-i-5B-5D">#[]</a> <li ><a href="#method-i-5B-5D-3D">#[]=</a> <li ><a href="#method-i-count">#count</a> <li ><a href="#method-i-set_error">#set_error</a> </ul> </div> </div> </nav> <main role="main" aria-labelledby="class-SQLite3::Database::FunctionProxy"> <h1 id="class-SQLite3::Database::FunctionProxy" class="class"> class SQLite3::Database::FunctionProxy </h1> <section class="description"> <p>A helper class for dealing with custom functions (see create_function, create_aggregate, and create_aggregate_handler). It encapsulates the opaque function object that represents the current invocation. It also provides more convenient access to the API functions that operate on the function object.</p> <p>This class will almost <em>always</em> be instantiated indirectly, by working with the create methods mentioned above.</p> </section> <section id="5Buntitled-5D" class="documentation-section"> <section class="attribute-method-details" class="method-section"> <header> <h3>Attributes</h3> </header> <div id="attribute-i-result" class="method-detail"> <div class="method-heading attribute-method-heading"> <span class="method-name">result</span><span class="attribute-access-type">[RW]</span> </div> <div class="method-description"> </div> </div> </section> <section id="public-class-5Buntitled-5D-method-details" class="method-section"> <header> <h3>Public Class Methods</h3> </header> <div id="method-c-new" class="method-detail "> <div class="method-heading"> <span class="method-name">new</span><span class="method-args">()</span> <span class="method-click-advice">click to toggle source</span> </div> <div class="method-description"> <p>Create a new <a href="FunctionProxy.html">FunctionProxy</a> that encapsulates the given <code>func</code> object. If context is non-nil, the functions context will be set to that. If it is non-nil, it must quack like a Hash. If it is nil, then none of the context functions will be available.</p> <div class="method-source-code" id="new-source"> <pre><span class="ruby-comment"># File lib/sqlite3/database.rb, line 684</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-ivar">@result</span> = <span class="ruby-keyword">nil</span> <span class="ruby-ivar">@context</span> = {} <span class="ruby-keyword">end</span></pre> </div> </div> </div> </section> <section id="public-instance-5Buntitled-5D-method-details" class="method-section"> <header> <h3>Public Instance Methods</h3> </header> <div id="method-i-5B-5D" class="method-detail "> <div class="method-heading"> <span class="method-name">[]</span><span class="method-args">( key )</span> <span class="method-click-advice">click to toggle source</span> </div> <div class="method-description"> <p>Returns the value with the given key from the context. This is only available to aggregate functions.</p> <div class="method-source-code" id="5B-5D-source"> <pre><span class="ruby-comment"># File lib/sqlite3/database.rb, line 704</span> <span class="ruby-keyword">def</span> <span class="ruby-operator">[]</span>( <span class="ruby-identifier">key</span> ) <span class="ruby-ivar">@context</span>[ <span class="ruby-identifier">key</span> ] <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div id="method-i-5B-5D-3D" class="method-detail "> <div class="method-heading"> <span class="method-name">[]=</span><span class="method-args">( key, value )</span> <span class="method-click-advice">click to toggle source</span> </div> <div class="method-description"> <p>Sets the value with the given key in the context. This is only available to aggregate functions.</p> <div class="method-source-code" id="5B-5D-3D-source"> <pre><span class="ruby-comment"># File lib/sqlite3/database.rb, line 710</span> <span class="ruby-keyword">def</span> <span class="ruby-operator">[]=</span>( <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span> ) <span class="ruby-ivar">@context</span>[ <span class="ruby-identifier">key</span> ] = <span class="ruby-identifier">value</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div id="method-i-count" class="method-detail "> <div class="method-heading"> <span class="method-name">count</span><span class="method-args">()</span> <span class="method-click-advice">click to toggle source</span> </div> <div class="method-description"> <p>(Only available to aggregate functions.) Returns the number of rows that the aggregate has processed so far. This will include the current row, and so will always return at least 1.</p> <div class="method-source-code" id="count-source"> <pre><span class="ruby-comment"># File lib/sqlite3/database.rb, line 698</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">count</span> <span class="ruby-ivar">@driver</span>.<span class="ruby-identifier">aggregate_count</span>( <span class="ruby-ivar">@func</span> ) <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div id="method-i-set_error" class="method-detail "> <div class="method-heading"> <span class="method-name">set_error</span><span class="method-args">( error )</span> <span class="method-click-advice">click to toggle source</span> </div> <div class="method-description"> <p>Set the result of the function to the given error message. The function will then return that error.</p> <div class="method-source-code" id="set_error-source"> <pre><span class="ruby-comment"># File lib/sqlite3/database.rb, line 691</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">set_error</span>( <span class="ruby-identifier">error</span> ) <span class="ruby-ivar">@driver</span>.<span class="ruby-identifier">result_error</span>( <span class="ruby-ivar">@func</span>, <span class="ruby-identifier">error</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">-1</span> ) <span class="ruby-keyword">end</span></pre> </div> </div> </div> </section> </section> </main> <footer id="validator-badges" role="contentinfo"> <p><a href="http://validator.w3.org/check/referer">Validate</a> <p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.0.1. <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>. </footer>
Save Changes