gitlabhq/doc/code/classes/StaticModel.html

377 lines
11 KiB
HTML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>StaticModel</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/github.css" type="text/css" media="screen" />
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Module</span>
StaticModel
</h1>
<ul class="files">
<li><a href="../files/app/roles/static_model_rb.html">app/roles/static_model.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<div class="description">
<p>Provides an ActiveRecord-like interface to a model whose data is not
persisted to a database.</p>
</div>
<!-- Namespace -->
<div class="sectiontitle">Namespace</div>
<ul>
<li>
<span class="type">MODULE</span>
<a href="StaticModel/ClassMethods.html">StaticModel::ClassMethods</a>
</li>
</ul>
<!-- Method ref -->
<div class="sectiontitle">Methods</div>
<dl class="methods">
<dt>#</dt>
<dd>
<ul>
<li>
<a href="#method-i-3D-3D">==</a>,
</li>
<li>
<a href="#method-i-5B-5D">[]</a>
</li>
</ul>
</dd>
<dt>D</dt>
<dd>
<ul>
<li>
<a href="#method-i-destroyed-3F">destroyed?</a>
</li>
</ul>
</dd>
<dt>N</dt>
<dd>
<ul>
<li>
<a href="#method-i-new_record-3F">new_record?</a>
</li>
</ul>
</dd>
<dt>P</dt>
<dd>
<ul>
<li>
<a href="#method-i-persisted-3F">persisted?</a>
</li>
</ul>
</dd>
<dt>T</dt>
<dd>
<ul>
<li>
<a href="#method-i-to_param">to_param</a>
</li>
</ul>
</dd>
</dl>
<!-- Methods -->
<div class="sectiontitle">Instance Public methods</div>
<div class="method">
<div class="title method-title" id="method-i-3D-3D">
<b>==</b>(other)
<a href="../classes/StaticModel.html#method-i-3D-3D" name="method-i-3D-3D" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-3D-3D_source')" id="l_method-i-3D-3D_source">show</a>
</p>
<div id="method-i-3D-3D_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/roles/static_model.rb, line 40</span>
<span class="ruby-keyword">def</span> <span class="ruby-operator">==</span>(<span class="ruby-keyword ruby-title">other</span>)
<span class="ruby-keyword">if</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">StaticModel</span>
<span class="ruby-identifier">id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">id</span>
<span class="ruby-keyword">else</span>
<span class="ruby-keyword">super</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-5B-5D">
<b>[]</b>(key)
<a href="../classes/StaticModel.html#method-i-5B-5D" name="method-i-5B-5D" class="permalink">Link</a>
</div>
<div class="description">
<p>Used by AR for fetching attributes</p>
<p>Pass it along if we respond to it.</p>
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-5B-5D_source')" id="l_method-i-5B-5D_source">show</a>
</p>
<div id="method-i-5B-5D_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/roles/static_model.rb, line 20</span>
<span class="ruby-keyword">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-keyword ruby-title">key</span>)
<span class="ruby-identifier">send</span>(<span class="ruby-identifier">key</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">key</span>)
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-destroyed-3F">
<b>destroyed?</b>()
<a href="../classes/StaticModel.html#method-i-destroyed-3F" name="method-i-destroyed-3F" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-destroyed-3F_source')" id="l_method-i-destroyed-3F_source">show</a>
</p>
<div id="method-i-destroyed-3F_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/roles/static_model.rb, line 36</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">destroyed?</span>
<span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-new_record-3F">
<b>new_record?</b>()
<a href="../classes/StaticModel.html#method-i-new_record-3F" name="method-i-new_record-3F" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-new_record-3F_source')" id="l_method-i-new_record-3F_source">show</a>
</p>
<div id="method-i-new_record-3F_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/roles/static_model.rb, line 28</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">new_record?</span>
<span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-persisted-3F">
<b>persisted?</b>()
<a href="../classes/StaticModel.html#method-i-persisted-3F" name="method-i-persisted-3F" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-persisted-3F_source')" id="l_method-i-persisted-3F_source">show</a>
</p>
<div id="method-i-persisted-3F_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/roles/static_model.rb, line 32</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">persisted?</span>
<span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-to_param">
<b>to_param</b>()
<a href="../classes/StaticModel.html#method-i-to_param" name="method-i-to_param" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-to_param_source')" id="l_method-i-to_param_source">show</a>
</p>
<div id="method-i-to_param_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/roles/static_model.rb, line 24</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">to_param</span>
<span class="ruby-identifier">id</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>