mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Generating docs for version 0a4c212.
This commit is contained in:
parent
0a4c212ccc
commit
76f835a896
@ -1,115 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActionController
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '';
|
||||
framesUrl = "frames.html#!ActionController.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="_index.html">Index (A)</a> »
|
||||
|
||||
|
||||
<span class="title">ActionController</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActionController
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/action_controller/serialization.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="ActionController/Serialization.html" title="ActionController::Serialization (module)">Serialization</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,348 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActionController::Serialization
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActionController/Serialization.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (S)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActionController.html" title="ActionController (module)">ActionController</a></span></span>
|
||||
»
|
||||
<span class="title">Serialization</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActionController::Serialization
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Concern</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Includes:</dt>
|
||||
<dd class="r2">Renderers</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/action_controller/serialization.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Serialization/ClassMethods.html" title="ActionController::Serialization::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#get_serializer-instance_method" title="#get_serializer (instance method)">- (Object) <strong>get_serializer</strong>(resource, options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serialization_scope-instance_method" title="#serialization_scope (instance method)">- (Object) <strong>serialization_scope</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#use_adapter%3F-instance_method" title="#use_adapter? (instance method)">- (Boolean) <strong>use_adapter?</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Deprecated.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="get_serializer-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>get_serializer</strong>(resource, options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
26
|
||||
27
|
||||
28
|
||||
29
|
||||
30
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37
|
||||
38
|
||||
39</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/action_controller/serialization.rb', line 26</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_get_serializer'>get_serializer</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_use_adapter?'>use_adapter?</span>
|
||||
<span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ActionController::Serialization#use_adapter? has been removed. </span><span class='tstring_end'>'</span></span>\
|
||||
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Please pass 'adapter: false' or see ActiveSupport::SerializableResource.new</span><span class='tstring_end'>"</span></span>
|
||||
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:adapter</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>false</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='id identifier rubyid_serializable_resource'>serializable_resource</span> <span class='op'>=</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>SerializableResource</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serializable_resource'>serializable_resource</span><span class='period'>.</span><span class='id identifier rubyid_serialization_scope'>serialization_scope</span> <span class='op'>||=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:scope</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_serialization_scope'>serialization_scope</span> <span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_serializable_resource'>serializable_resource</span><span class='period'>.</span><span class='id identifier rubyid_serialization_scope_name'>serialization_scope_name</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:scope_name</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid__serialization_scope'>_serialization_scope</span> <span class='rbrace'>}</span>
|
||||
<span class='comment'># For compatibility with the JSON renderer: `json.to_json(options) if json.is_a?(String)`.
|
||||
</span> <span class='comment'># Otherwise, since `serializable_resource` is not a string, the renderer would call
|
||||
</span> <span class='comment'># `to_json` on a String and given odd results, such as `"".to_json #=> '""'`
|
||||
</span> <span class='id identifier rubyid_serializable_resource'>serializable_resource</span><span class='period'>.</span><span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_serializable_resource'>serializable_resource</span><span class='period'>.</span><span class='id identifier rubyid_adapter'>adapter</span> <span class='op'>:</span> <span class='id identifier rubyid_serializable_resource'>serializable_resource</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serialization_scope-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serialization_scope</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
21
|
||||
22
|
||||
23
|
||||
24</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/action_controller/serialization.rb', line 21</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serialization_scope'>serialization_scope</span>
|
||||
<span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid__serialization_scope'>_serialization_scope</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid__serialization_scope'>_serialization_scope</span> <span class='op'>&&</span>
|
||||
<span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid__serialization_scope'>_serialization_scope</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="use_adapter?-instance_method">
|
||||
|
||||
- (<tt>Boolean</tt>) <strong>use_adapter?</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Deprecated</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
42
|
||||
43
|
||||
44</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/action_controller/serialization.rb', line 42</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_use_adapter?'>use_adapter?</span>
|
||||
<span class='kw'>true</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,174 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActionController::Serialization::ClassMethods
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActionController/Serialization/ClassMethods.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActionController.html" title="ActionController (module)">ActionController</a></span></span> » <span class='title'><span class='object_link'><a href="../Serialization.html" title="ActionController::Serialization (module)">Serialization</a></span></span>
|
||||
»
|
||||
<span class="title">ClassMethods</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActionController::Serialization::ClassMethods
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/action_controller/serialization.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serialization_scope-instance_method" title="#serialization_scope (instance method)">- (Object) <strong>serialization_scope</strong>(scope) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="serialization_scope-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serialization_scope</strong>(scope)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
11
|
||||
12
|
||||
13</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/action_controller/serialization.rb', line 11</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serialization_scope'>serialization_scope</span><span class='lparen'>(</span><span class='id identifier rubyid_scope'>scope</span><span class='rparen'>)</span>
|
||||
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__serialization_scope'>_serialization_scope</span> <span class='op'>=</span> <span class='id identifier rubyid_scope'>scope</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
129
ActiveModel.html
129
ActiveModel.html
@ -1,129 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '';
|
||||
framesUrl = "frames.html#!ActiveModel.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="_index.html">Index (A)</a> »
|
||||
|
||||
|
||||
<span class="title">ActiveModel</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer.rb<span class="defines">,<br />
|
||||
lib/active_model/serializer/type.rb,<br /> lib/active_model/serializer/null.rb,<br /> lib/active_model/serializer/meta.rb,<br /> lib/active_model/serializer/field.rb,<br /> lib/active_model/serializer/links.rb,<br /> lib/active_model/serializer/adapter.rb,<br /> lib/active_model/serializer/version.rb,<br /> lib/active_model/serializer/caching.rb,<br /> lib/active_model/serializer/fieldset.rb,<br /> lib/active_model/serializer/attribute.rb,<br /> lib/active_model/serializer/reflection.rb,<br /> lib/active_model/serializable_resource.rb,<br /> lib/active_model/serializer/attributes.rb,<br /> lib/active_model/serializer/association.rb,<br /> lib/active_model/serializer/associations.rb,<br /> lib/active_model/serializer/adapter/json.rb,<br /> lib/active_model/serializer/adapter/null.rb,<br /> lib/active_model/serializer/adapter/base.rb,<br /> lib/active_model/serializer/configuration.rb,<br /> lib/active_model/serializer/adapter/json_api.rb,<br /> lib/active_model/serializer/has_one_reflection.rb,<br /> lib/active_model/serializer/adapter/attributes.rb,<br /> lib/active_model/serializer/singular_reflection.rb,<br /> lib/active_model/serializer/has_many_reflection.rb,<br /> lib/active_model/serializer/collection_reflection.rb,<br /> lib/active_model/serializer/belongs_to_reflection.rb,<br /> lib/active_model/serializer/collection_serializer.rb</span>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>ActiveModel::Serializer is an abstract class that is reified when
|
||||
subclassed to decorate a resource.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
|
||||
|
||||
<strong class="classes">Classes:</strong> <span class='object_link'><a href="ActiveModel/SerializableResource.html" title="ActiveModel::SerializableResource (class)">SerializableResource</a></span>, <span class='object_link'><a href="ActiveModel/Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span>
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:35 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,135 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::SerializableResource
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModel/SerializableResource.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (S)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span>
|
||||
»
|
||||
<span class="title">SerializableResource</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::SerializableResource
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModel::SerializableResource</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Extended by:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializable_resource.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Method Summary</h2>
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../ActiveModelSerializers/Deprecate.html#delegate_and_deprecate-class_method" title="ActiveModelSerializers::Deprecate.delegate_and_deprecate (method)">delegate_and_deprecate</a></span>, <span class='object_link'><a href="../ActiveModelSerializers/Deprecate.html#deprecate-class_method" title="ActiveModelSerializers::Deprecate.deprecate (method)">deprecate</a></span></p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:38 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,156 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Adapter
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Adapter.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Adapter</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Adapter
|
||||
|
||||
<span class="deprecated note title">Deprecated</span>
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1"><span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/adapter.rb<span class="defines">,<br />
|
||||
lib/active_model/serializer/adapter/json.rb,<br /> lib/active_model/serializer/adapter/null.rb,<br /> lib/active_model/serializer/adapter/base.rb,<br /> lib/active_model/serializer/adapter/json_api.rb,<br /> lib/active_model/serializer/adapter/attributes.rb</span>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
<div class="note deprecated"><strong>Deprecated.</strong> <div class='inline'>
|
||||
<p>Use ActiveModelSerializers::Adapter instead</p>
|
||||
</div></div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
|
||||
|
||||
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Adapter/Attributes.html" title="ActiveModel::Serializer::Adapter::Attributes (class)">Attributes</a></span>, <span class='object_link'><a href="Adapter/Base.html" title="ActiveModel::Serializer::Adapter::Base (class)">Base</a></span>, <span class='object_link'><a href="Adapter/Json.html" title="ActiveModel::Serializer::Adapter::Json (class)">Json</a></span>, <span class='object_link'><a href="Adapter/JsonApi.html" title="ActiveModel::Serializer::Adapter::JsonApi (class)">JsonApi</a></span>, <span class='object_link'><a href="Adapter/Null.html" title="ActiveModel::Serializer::Adapter::Null (class)">Null</a></span>
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<dl class="constants">
|
||||
|
||||
<dt id="DEPRECATED_METHODS-constant" class="">DEPRECATED_METHODS =
|
||||
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='lbracket'>[</span><span class='symbol'>:create</span><span class='comma'>,</span> <span class='symbol'>:adapter_class</span><span class='comma'>,</span> <span class='symbol'>:adapter_map</span><span class='comma'>,</span> <span class='symbol'>:adapters</span><span class='comma'>,</span> <span class='symbol'>:register</span><span class='comma'>,</span> <span class='symbol'>:lookup</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Method Summary</h2>
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html#delegate_and_deprecate-class_method" title="ActiveModelSerializers::Deprecate.delegate_and_deprecate (method)">delegate_and_deprecate</a></span>, <span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html#deprecate-class_method" title="ActiveModelSerializers::Deprecate.deprecate (method)">deprecate</a></span></p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,248 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::Adapter::Attributes
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModel/Serializer/Adapter/Attributes.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span> » <span class='title'><span class='object_link'><a href="../Adapter.html" title="ActiveModel::Serializer::Adapter (module)">Adapter</a></span></span>
|
||||
»
|
||||
<span class="title">Attributes</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::Adapter::Attributes
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Attributes.html" title="ActiveModelSerializers::Adapter::Attributes (class)">ActiveModelSerializers::Adapter::Attributes</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Attributes.html" title="ActiveModelSerializers::Adapter::Attributes (class)">ActiveModelSerializers::Adapter::Attributes</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::Adapter::Attributes</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Extended by:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/adapter/attributes.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#instance_options-instance_method" title="ActiveModelSerializers::Adapter::Base#instance_options (method)">#instance_options</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#serializer-instance_method" title="ActiveModelSerializers::Adapter::Base#serializer (method)">#serializer</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Attributes) <strong>initialize</strong>(serializer, options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of Attributes.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html#delegate_and_deprecate-class_method" title="ActiveModelSerializers::Deprecate.delegate_and_deprecate (method)">delegate_and_deprecate</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html#deprecate-class_method" title="ActiveModelSerializers::Deprecate.deprecate (method)">deprecate</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Attributes.html" title="ActiveModelSerializers::Adapter::Attributes (class)">ActiveModelSerializers::Adapter::Attributes</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Attributes.html#serializable_hash-instance_method" title="ActiveModelSerializers::Adapter::Attributes#serializable_hash (method)">#serializable_hash</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#as_json-instance_method" title="ActiveModelSerializers::Adapter::Base#as_json (method)">#as_json</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#cache_key-class_method" title="ActiveModelSerializers::Adapter::Base.cache_key (method)">cache_key</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#cache_key-instance_method" title="ActiveModelSerializers::Adapter::Base#cache_key (method)">#cache_key</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#default_key_transform-class_method" title="ActiveModelSerializers::Adapter::Base.default_key_transform (method)">default_key_transform</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#fragment_cache-instance_method" title="ActiveModelSerializers::Adapter::Base#fragment_cache (method)">#fragment_cache</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#fragment_cache-class_method" title="ActiveModelSerializers::Adapter::Base.fragment_cache (method)">fragment_cache</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#inherited-class_method" title="ActiveModelSerializers::Adapter::Base.inherited (method)">inherited</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#serializable_hash-instance_method" title="ActiveModelSerializers::Adapter::Base#serializable_hash (method)">#serializable_hash</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#transform-class_method" title="ActiveModelSerializers::Adapter::Base.transform (method)">transform</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#transform_key_casing%21-class_method" title="ActiveModelSerializers::Adapter::Base.transform_key_casing! (method)">transform_key_casing!</a></span></p>
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModel::Serializer::Adapter::Attributes (class)">Attributes</a></span></tt>) <strong>initialize</strong>(serializer, options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of Attributes</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
5
|
||||
6
|
||||
7</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/adapter/attributes.rb', line 5</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span><span class='lparen'>(</span><span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Adapter</span><span class='op'>::</span><span class='const'>Attributes</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,235 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::Adapter::Base
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModel/Serializer/Adapter/Base.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (B)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span> » <span class='title'><span class='object_link'><a href="../Adapter.html" title="ActiveModel::Serializer::Adapter (module)">Adapter</a></span></span>
|
||||
»
|
||||
<span class="title">Base</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::Adapter::Base
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::Adapter::Base</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Extended by:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/adapter/base.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#instance_options-instance_method" title="ActiveModelSerializers::Adapter::Base#instance_options (method)">#instance_options</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#serializer-instance_method" title="ActiveModelSerializers::Adapter::Base#serializer (method)">#serializer</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Base) <strong>initialize</strong>(serializer, options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>:nocov:.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html#delegate_and_deprecate-class_method" title="ActiveModelSerializers::Deprecate.delegate_and_deprecate (method)">delegate_and_deprecate</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html#deprecate-class_method" title="ActiveModelSerializers::Deprecate.deprecate (method)">deprecate</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#as_json-instance_method" title="ActiveModelSerializers::Adapter::Base#as_json (method)">#as_json</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#cache_key-class_method" title="ActiveModelSerializers::Adapter::Base.cache_key (method)">cache_key</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#cache_key-instance_method" title="ActiveModelSerializers::Adapter::Base#cache_key (method)">#cache_key</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#default_key_transform-class_method" title="ActiveModelSerializers::Adapter::Base.default_key_transform (method)">default_key_transform</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#fragment_cache-instance_method" title="ActiveModelSerializers::Adapter::Base#fragment_cache (method)">#fragment_cache</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#fragment_cache-class_method" title="ActiveModelSerializers::Adapter::Base.fragment_cache (method)">fragment_cache</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#inherited-class_method" title="ActiveModelSerializers::Adapter::Base.inherited (method)">inherited</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#serializable_hash-instance_method" title="ActiveModelSerializers::Adapter::Base#serializable_hash (method)">#serializable_hash</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#transform-class_method" title="ActiveModelSerializers::Adapter::Base.transform (method)">transform</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#transform_key_casing%21-class_method" title="ActiveModelSerializers::Adapter::Base.transform_key_casing! (method)">transform_key_casing!</a></span></p>
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModel::Serializer::Adapter::Base (class)">Base</a></span></tt>) <strong>initialize</strong>(serializer, options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>:nocov:</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
11
|
||||
12
|
||||
13</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/adapter/base.rb', line 11</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span><span class='lparen'>(</span><span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Adapter</span><span class='op'>::</span><span class='const'>Base</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,248 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::Adapter::Json
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModel/Serializer/Adapter/Json.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (J)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span> » <span class='title'><span class='object_link'><a href="../Adapter.html" title="ActiveModel::Serializer::Adapter (module)">Adapter</a></span></span>
|
||||
»
|
||||
<span class="title">Json</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::Adapter::Json
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Json.html" title="ActiveModelSerializers::Adapter::Json (class)">ActiveModelSerializers::Adapter::Json</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Json.html" title="ActiveModelSerializers::Adapter::Json (class)">ActiveModelSerializers::Adapter::Json</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::Adapter::Json</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Extended by:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/adapter/json.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#instance_options-instance_method" title="ActiveModelSerializers::Adapter::Base#instance_options (method)">#instance_options</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#serializer-instance_method" title="ActiveModelSerializers::Adapter::Base#serializer (method)">#serializer</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Json) <strong>initialize</strong>(serializer, options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of Json.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html#delegate_and_deprecate-class_method" title="ActiveModelSerializers::Deprecate.delegate_and_deprecate (method)">delegate_and_deprecate</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html#deprecate-class_method" title="ActiveModelSerializers::Deprecate.deprecate (method)">deprecate</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Json.html" title="ActiveModelSerializers::Adapter::Json (class)">ActiveModelSerializers::Adapter::Json</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Json.html#meta-instance_method" title="ActiveModelSerializers::Adapter::Json#meta (method)">#meta</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Json.html#meta_key-instance_method" title="ActiveModelSerializers::Adapter::Json#meta_key (method)">#meta_key</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Json.html#serializable_hash-instance_method" title="ActiveModelSerializers::Adapter::Json#serializable_hash (method)">#serializable_hash</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#as_json-instance_method" title="ActiveModelSerializers::Adapter::Base#as_json (method)">#as_json</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#cache_key-class_method" title="ActiveModelSerializers::Adapter::Base.cache_key (method)">cache_key</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#cache_key-instance_method" title="ActiveModelSerializers::Adapter::Base#cache_key (method)">#cache_key</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#default_key_transform-class_method" title="ActiveModelSerializers::Adapter::Base.default_key_transform (method)">default_key_transform</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#fragment_cache-instance_method" title="ActiveModelSerializers::Adapter::Base#fragment_cache (method)">#fragment_cache</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#fragment_cache-class_method" title="ActiveModelSerializers::Adapter::Base.fragment_cache (method)">fragment_cache</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#inherited-class_method" title="ActiveModelSerializers::Adapter::Base.inherited (method)">inherited</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#serializable_hash-instance_method" title="ActiveModelSerializers::Adapter::Base#serializable_hash (method)">#serializable_hash</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#transform-class_method" title="ActiveModelSerializers::Adapter::Base.transform (method)">transform</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#transform_key_casing%21-class_method" title="ActiveModelSerializers::Adapter::Base.transform_key_casing! (method)">transform_key_casing!</a></span></p>
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModel::Serializer::Adapter::Json (class)">Json</a></span></tt>) <strong>initialize</strong>(serializer, options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of Json</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
5
|
||||
6
|
||||
7</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/adapter/json.rb', line 5</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span><span class='lparen'>(</span><span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Adapter</span><span class='op'>::</span><span class='const'>Json</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,249 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::Adapter::JsonApi
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModel/Serializer/Adapter/JsonApi.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (J)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span> » <span class='title'><span class='object_link'><a href="../Adapter.html" title="ActiveModel::Serializer::Adapter (module)">Adapter</a></span></span>
|
||||
»
|
||||
<span class="title">JsonApi</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::Adapter::JsonApi
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/JsonApi.html" title="ActiveModelSerializers::Adapter::JsonApi (class)">ActiveModelSerializers::Adapter::JsonApi</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/JsonApi.html" title="ActiveModelSerializers::Adapter::JsonApi (class)">ActiveModelSerializers::Adapter::JsonApi</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::Adapter::JsonApi</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Extended by:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/adapter/json_api.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#instance_options-instance_method" title="ActiveModelSerializers::Adapter::Base#instance_options (method)">#instance_options</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#serializer-instance_method" title="ActiveModelSerializers::Adapter::Base#serializer (method)">#serializer</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (JsonApi) <strong>initialize</strong>(serializer, options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of JsonApi.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html#delegate_and_deprecate-class_method" title="ActiveModelSerializers::Deprecate.delegate_and_deprecate (method)">delegate_and_deprecate</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html#deprecate-class_method" title="ActiveModelSerializers::Deprecate.deprecate (method)">deprecate</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/JsonApi.html" title="ActiveModelSerializers::Adapter::JsonApi (class)">ActiveModelSerializers::Adapter::JsonApi</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/JsonApi.html#default_key_transform-class_method" title="ActiveModelSerializers::Adapter::JsonApi.default_key_transform (method)">default_key_transform</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/JsonApi.html#failure_document-instance_method" title="ActiveModelSerializers::Adapter::JsonApi#failure_document (method)">#failure_document</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/JsonApi.html#fragment_cache-instance_method" title="ActiveModelSerializers::Adapter::JsonApi#fragment_cache (method)">#fragment_cache</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/JsonApi.html#fragment_cache-class_method" title="ActiveModelSerializers::Adapter::JsonApi.fragment_cache (method)">fragment_cache</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/JsonApi.html#serializable_hash-instance_method" title="ActiveModelSerializers::Adapter::JsonApi#serializable_hash (method)">#serializable_hash</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/JsonApi.html#success_document-instance_method" title="ActiveModelSerializers::Adapter::JsonApi#success_document (method)">#success_document</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#as_json-instance_method" title="ActiveModelSerializers::Adapter::Base#as_json (method)">#as_json</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#cache_key-class_method" title="ActiveModelSerializers::Adapter::Base.cache_key (method)">cache_key</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#cache_key-instance_method" title="ActiveModelSerializers::Adapter::Base#cache_key (method)">#cache_key</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#default_key_transform-class_method" title="ActiveModelSerializers::Adapter::Base.default_key_transform (method)">default_key_transform</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#fragment_cache-instance_method" title="ActiveModelSerializers::Adapter::Base#fragment_cache (method)">#fragment_cache</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#fragment_cache-class_method" title="ActiveModelSerializers::Adapter::Base.fragment_cache (method)">fragment_cache</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#inherited-class_method" title="ActiveModelSerializers::Adapter::Base.inherited (method)">inherited</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#serializable_hash-instance_method" title="ActiveModelSerializers::Adapter::Base#serializable_hash (method)">#serializable_hash</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#transform-class_method" title="ActiveModelSerializers::Adapter::Base.transform (method)">transform</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#transform_key_casing%21-class_method" title="ActiveModelSerializers::Adapter::Base.transform_key_casing! (method)">transform_key_casing!</a></span></p>
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModel::Serializer::Adapter::JsonApi (class)">JsonApi</a></span></tt>) <strong>initialize</strong>(serializer, options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of JsonApi</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
5
|
||||
6
|
||||
7</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/adapter/json_api.rb', line 5</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span><span class='lparen'>(</span><span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Adapter</span><span class='op'>::</span><span class='const'>JsonApi</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,248 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::Adapter::Null
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModel/Serializer/Adapter/Null.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (N)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span> » <span class='title'><span class='object_link'><a href="../Adapter.html" title="ActiveModel::Serializer::Adapter (module)">Adapter</a></span></span>
|
||||
»
|
||||
<span class="title">Null</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::Adapter::Null
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Null.html" title="ActiveModelSerializers::Adapter::Null (class)">ActiveModelSerializers::Adapter::Null</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Null.html" title="ActiveModelSerializers::Adapter::Null (class)">ActiveModelSerializers::Adapter::Null</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::Adapter::Null</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Extended by:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/adapter/null.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#instance_options-instance_method" title="ActiveModelSerializers::Adapter::Base#instance_options (method)">#instance_options</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#serializer-instance_method" title="ActiveModelSerializers::Adapter::Base#serializer (method)">#serializer</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Null) <strong>initialize</strong>(serializer, options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of Null.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html#delegate_and_deprecate-class_method" title="ActiveModelSerializers::Deprecate.delegate_and_deprecate (method)">delegate_and_deprecate</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Deprecate.html#deprecate-class_method" title="ActiveModelSerializers::Deprecate.deprecate (method)">deprecate</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Null.html" title="ActiveModelSerializers::Adapter::Null (class)">ActiveModelSerializers::Adapter::Null</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Null.html#serializable_hash-instance_method" title="ActiveModelSerializers::Adapter::Null#serializable_hash (method)">#serializable_hash</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">ActiveModelSerializers::Adapter::Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#as_json-instance_method" title="ActiveModelSerializers::Adapter::Base#as_json (method)">#as_json</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#cache_key-class_method" title="ActiveModelSerializers::Adapter::Base.cache_key (method)">cache_key</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#cache_key-instance_method" title="ActiveModelSerializers::Adapter::Base#cache_key (method)">#cache_key</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#default_key_transform-class_method" title="ActiveModelSerializers::Adapter::Base.default_key_transform (method)">default_key_transform</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#fragment_cache-instance_method" title="ActiveModelSerializers::Adapter::Base#fragment_cache (method)">#fragment_cache</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#fragment_cache-class_method" title="ActiveModelSerializers::Adapter::Base.fragment_cache (method)">fragment_cache</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#inherited-class_method" title="ActiveModelSerializers::Adapter::Base.inherited (method)">inherited</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#serializable_hash-instance_method" title="ActiveModelSerializers::Adapter::Base#serializable_hash (method)">#serializable_hash</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#transform-class_method" title="ActiveModelSerializers::Adapter::Base.transform (method)">transform</a></span>, <span class='object_link'><a href="../../../ActiveModelSerializers/Adapter/Base.html#transform_key_casing%21-class_method" title="ActiveModelSerializers::Adapter::Base.transform_key_casing! (method)">transform_key_casing!</a></span></p>
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModel::Serializer::Adapter::Null (class)">Null</a></span></tt>) <strong>initialize</strong>(serializer, options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of Null</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
5
|
||||
6
|
||||
7</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/adapter/null.rb', line 5</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span><span class='lparen'>(</span><span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Adapter</span><span class='op'>::</span><span class='const'>Null</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,169 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::ArraySerializer
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/ArraySerializer.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">ArraySerializer</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::ArraySerializer
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="CollectionSerializer.html" title="ActiveModel::Serializer::CollectionSerializer (class)">CollectionSerializer</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="CollectionSerializer.html" title="ActiveModel::Serializer::CollectionSerializer (class)">CollectionSerializer</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::ArraySerializer</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Extended by:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/array_serializer.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<h3 class="inherited">Constants inherited
|
||||
from <span class='object_link'><a href="CollectionSerializer.html" title="ActiveModel::Serializer::CollectionSerializer (class)">CollectionSerializer</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="CollectionSerializer.html#NoSerializerError-constant" title="ActiveModel::Serializer::CollectionSerializer::NoSerializerError (constant)">CollectionSerializer::NoSerializerError</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="CollectionSerializer.html" title="ActiveModel::Serializer::CollectionSerializer (class)">CollectionSerializer</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="CollectionSerializer.html#object-instance_method" title="ActiveModel::Serializer::CollectionSerializer#object (method)">#object</a></span>, <span class='object_link'><a href="CollectionSerializer.html#root-instance_method" title="ActiveModel::Serializer::CollectionSerializer#root (method)">#root</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Method Summary</h2>
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html#delegate_and_deprecate-class_method" title="ActiveModelSerializers::Deprecate.delegate_and_deprecate (method)">delegate_and_deprecate</a></span>, <span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html#deprecate-class_method" title="ActiveModelSerializers::Deprecate.deprecate (method)">deprecate</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="CollectionSerializer.html" title="ActiveModel::Serializer::CollectionSerializer (class)">CollectionSerializer</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="CollectionSerializer.html#initialize-instance_method" title="ActiveModel::Serializer::CollectionSerializer#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="CollectionSerializer.html#json_key-instance_method" title="ActiveModel::Serializer::CollectionSerializer#json_key (method)">#json_key</a></span>, <span class='object_link'><a href="CollectionSerializer.html#paginated%3F-instance_method" title="ActiveModel::Serializer::CollectionSerializer#paginated? (method)">#paginated?</a></span>, <span class='object_link'><a href="CollectionSerializer.html#serializable_hash-instance_method" title="ActiveModel::Serializer::CollectionSerializer#serializable_hash (method)">#serializable_hash</a></span>, <span class='object_link'><a href="CollectionSerializer.html#success%3F-instance_method" title="ActiveModel::Serializer::CollectionSerializer#success? (method)">#success?</a></span></p>
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="CollectionSerializer.html#initialize-instance_method" title="ActiveModel::Serializer::CollectionSerializer#initialize (method)">ActiveModel::Serializer::CollectionSerializer</a></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,592 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::Association
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Association.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Association</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::Association
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Struct</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">Struct</li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::Association</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/association.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>This class hold all information about serializer's association.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='const'>Association</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:comments</span><span class='comma'>,</span> <span class='const'>CommentSummarySerializer</span><span class='rparen'>)</span></code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#links-instance_method" title="#links (instance method)">- (Object) <strong>links</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute links.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#meta-instance_method" title="#meta (instance method)">- (Object) <strong>meta</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute meta.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#name-instance_method" title="#name (instance method)">- (Symbol) <strong>name</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>The current value of name.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#options-instance_method" title="#options (instance method)">- (Hash{Symbol => Object}) <strong>options</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>The current value of options.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serializer-instance_method" title="#serializer (instance method)">- (ActiveModel::Serializer) <strong>serializer</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>The current value of serializer.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_attr_details" class="attr_details">
|
||||
<h2>Instance Attribute Details</h2>
|
||||
|
||||
|
||||
<span id="links=-instance_method"></span>
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="links-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>links</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute links</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Object</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>the current value of links</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
12
|
||||
13
|
||||
14</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/association.rb', line 12</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_links'>links</span>
|
||||
<span class='ivar'>@links</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id="meta=-instance_method"></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="meta-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>meta</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute meta</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Object</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>the current value of meta</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
12
|
||||
13
|
||||
14</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/association.rb', line 12</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_meta'>meta</span>
|
||||
<span class='ivar'>@meta</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id="name=-instance_method"></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="name-instance_method">
|
||||
|
||||
- (<tt>Symbol</tt>) <strong>name</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the current value of name</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Symbol</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>the current value of name</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
12
|
||||
13
|
||||
14</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/association.rb', line 12</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
|
||||
<span class='ivar'>@name</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id="options=-instance_method"></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="options-instance_method">
|
||||
|
||||
- (<tt>Hash{Symbol => Object}</tt>) <strong>options</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the current value of options</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Hash{Symbol => Object}</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>the current value of options</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
12
|
||||
13
|
||||
14</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/association.rb', line 12</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span>
|
||||
<span class='ivar'>@options</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id="serializer=-instance_method"></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serializer-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></tt>) <strong>serializer</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the current value of serializer</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>the current value of serializer</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
12
|
||||
13
|
||||
14</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/association.rb', line 12</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serializer'>serializer</span>
|
||||
<span class='ivar'>@serializer</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,272 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Associations
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Associations.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Associations</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Associations
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Concern</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Included in:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></dd>
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/associations.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Defines an association in the object should be rendered.</p>
|
||||
|
||||
<p>The serializer object should implement the association name as a method
|
||||
which should return an array when invoked. If a method with the association
|
||||
name does not exist, the association name is dispatched to the serialized
|
||||
object.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Associations/ClassMethods.html" title="ActiveModel::Serializer::Associations::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#associations-instance_method" title="#associations (instance method)">- (Enumerator<Association>) <strong>associations</strong>(include_directive = ActiveModelSerializers.default_include_directive) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="associations-instance_method">
|
||||
|
||||
- (<tt>Enumerator<<span class='object_link'><a href="Association.html" title="ActiveModel::Serializer::Association (class)">Association</a></span>></tt>) <strong>associations</strong>(include_directive = ActiveModelSerializers.default_include_directive)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
<p class="tag_title">Parameters:</p>
|
||||
<ul class="param">
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>include_directive</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>JSONAPI::IncludeDirective</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>ActiveModelSerializers.default_include_directive</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>(defaults to the <code>default_include_directive</code> config value when
|
||||
not provided)</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Enumerator<<span class='object_link'><a href="Association.html" title="ActiveModel::Serializer::Association (class)">Association</a></span>></tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
85
|
||||
86
|
||||
87
|
||||
88
|
||||
89
|
||||
90
|
||||
91
|
||||
92
|
||||
93
|
||||
94
|
||||
95
|
||||
96</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/associations.rb', line 85</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_associations'>associations</span><span class='lparen'>(</span><span class='id identifier rubyid_include_directive'>include_directive</span> <span class='op'>=</span> <span class='const'>ActiveModelSerializers</span><span class='period'>.</span><span class='id identifier rubyid_default_include_directive'>default_include_directive</span><span class='rparen'>)</span>
|
||||
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_object'>object</span>
|
||||
|
||||
<span class='const'>Enumerator</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_y'>y</span><span class='op'>|</span>
|
||||
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid__reflections'>_reflections</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_reflection'>reflection</span><span class='op'>|</span>
|
||||
<span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_reflection'>reflection</span><span class='period'>.</span><span class='id identifier rubyid_excluded?'>excluded?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_reflection'>reflection</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:key</span><span class='comma'>,</span> <span class='id identifier rubyid_reflection'>reflection</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
||||
<span class='kw'>next</span> <span class='kw'>unless</span> <span class='id identifier rubyid_include_directive'>include_directive</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_y'>y</span><span class='period'>.</span><span class='id identifier rubyid_yield'>yield</span> <span class='id identifier rubyid_reflection'>reflection</span><span class='period'>.</span><span class='id identifier rubyid_build_association'>build_association</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_instance_options'>instance_options</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,497 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Associations::ClassMethods
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModel/Serializer/Associations/ClassMethods.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span> » <span class='title'><span class='object_link'><a href="../Associations.html" title="ActiveModel::Serializer::Associations (module)">Associations</a></span></span>
|
||||
»
|
||||
<span class="title">ClassMethods</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Associations::ClassMethods
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/associations.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#belongs_to-instance_method" title="#belongs_to (instance method)">- (void) <strong>belongs_to</strong>(name, options = {}, &block) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#has_many-instance_method" title="#has_many (instance method)">- (void) <strong>has_many</strong>(name, options = {}, &block) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#has_one-instance_method" title="#has_one (instance method)">- (void) <strong>has_one</strong>(name, options = {}, &block) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#inherited-instance_method" title="#inherited (instance method)">- (Object) <strong>inherited</strong>(base) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="belongs_to-instance_method">
|
||||
|
||||
- (<tt>void</tt>) <strong>belongs_to</strong>(name, options = {}, &block)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
<p class="note returns_void">This method returns an undefined value.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='id identifier rubyid_belongs_to'>belongs_to</span> <span class='symbol'>:author</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='const'>AuthorSerializer</span></code></pre>
|
||||
|
||||
</div>
|
||||
<p class="tag_title">Parameters:</p>
|
||||
<ul class="param">
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>name</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Symbol</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>of the association</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>options</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Hash<Symbol => any></tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>for the reflection</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
53
|
||||
54
|
||||
55</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/associations.rb', line 53</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_belongs_to'>belongs_to</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_associate'>associate</span><span class='lparen'>(</span><span class='const'>BelongsToReflection</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="has_many-instance_method">
|
||||
|
||||
- (<tt>void</tt>) <strong>has_many</strong>(name, options = {}, &block)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
<p class="note returns_void">This method returns an undefined value.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='id identifier rubyid_has_many'>has_many</span> <span class='symbol'>:comments</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='const'>CommentSummarySerializer</span></code></pre>
|
||||
|
||||
</div>
|
||||
<p class="tag_title">Parameters:</p>
|
||||
<ul class="param">
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>name</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Symbol</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>of the association</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>options</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Hash<Symbol => any></tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>for the reflection</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
42
|
||||
43
|
||||
44</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/associations.rb', line 42</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_has_many'>has_many</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_associate'>associate</span><span class='lparen'>(</span><span class='const'>HasManyReflection</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="has_one-instance_method">
|
||||
|
||||
- (<tt>void</tt>) <strong>has_one</strong>(name, options = {}, &block)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
<p class="note returns_void">This method returns an undefined value.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='id identifier rubyid_has_one'>has_one</span> <span class='symbol'>:author</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='const'>AuthorSerializer</span></code></pre>
|
||||
|
||||
</div>
|
||||
<p class="tag_title">Parameters:</p>
|
||||
<ul class="param">
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>name</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Symbol</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>of the association</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>options</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Hash<Symbol => any></tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>for the reflection</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
64
|
||||
65
|
||||
66</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/associations.rb', line 64</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_has_one'>has_one</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_associate'>associate</span><span class='lparen'>(</span><span class='const'>HasOneReflection</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="inherited-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>inherited</strong>(base)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
30
|
||||
31
|
||||
32
|
||||
33</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/associations.rb', line 30</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_inherited'>inherited</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span>
|
||||
<span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid__reflections'>_reflections</span> <span class='op'>=</span> <span class='id identifier rubyid__reflections'>_reflections</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,167 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::Attribute
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Attribute.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Attribute</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::Attribute
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">Struct</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::Attribute</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/attribute.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Holds all the meta-data about an attribute as it was specified in the
|
||||
ActiveModel::Serializer class.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='kw'>class</span> <span class='const'>PostSerializer</span> <span class='op'><</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span>
|
||||
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:content</span>
|
||||
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>key:</span> <span class='symbol'>:title</span>
|
||||
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:email</span><span class='comma'>,</span> <span class='label'>key:</span> <span class='symbol'>:author_email</span><span class='comma'>,</span> <span class='label'>if:</span> <span class='symbol'>:user_logged_in?</span>
|
||||
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:preview</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_truncate'>truncate</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_user_logged_in?'>user_logged_in?</span>
|
||||
<span class='id identifier rubyid_current_user'>current_user</span><span class='period'>.</span><span class='id identifier rubyid_logged_in?'>logged_in?</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Field.html#block-instance_method" title="ActiveModel::Serializer::Field#block (method)">#block</a></span>, <span class='object_link'><a href="Field.html#name-instance_method" title="ActiveModel::Serializer::Field#name (method)">#name</a></span>, <span class='object_link'><a href="Field.html#options-instance_method" title="ActiveModel::Serializer::Field#options (method)">#options</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:38 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,124 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Attributes
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Attributes.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Attributes</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Attributes
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Concern</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Included in:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></dd>
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/attributes.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Attributes/ClassMethods.html" title="ActiveModel::Serializer::Attributes::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,497 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Attributes::ClassMethods
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModel/Serializer/Attributes/ClassMethods.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span> » <span class='title'><span class='object_link'><a href="../Attributes.html" title="ActiveModel::Serializer::Attributes (module)">Attributes</a></span></span>
|
||||
»
|
||||
<span class="title">ClassMethods</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Attributes::ClassMethods
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/attributes.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#_attributes-instance_method" title="#_attributes (instance method)">- (Object) <strong>_attributes</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="private note title">private</span>
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>keys of attributes.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#_attributes_keys-instance_method" title="#_attributes_keys (instance method)">- (Object) <strong>_attributes_keys</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="private note title">private</span>
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>maps attribute value to explict key name.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#attribute-instance_method" title="#attribute (instance method)">- (Object) <strong>attribute</strong>(attr, options = {}, &block) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#attributes-instance_method" title="#attributes (instance method)">- (Object) <strong>attributes</strong>(*attrs) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#inherited-instance_method" title="#inherited (instance method)">- (Object) <strong>inherited</strong>(base) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="_attributes-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>_attributes</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
<p class="note private">
|
||||
<strong>This method is part of a private API.</strong>
|
||||
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
||||
</p>
|
||||
|
||||
<p>keys of attributes</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
<p class="tag_title">See Also:</p>
|
||||
<ul class="see">
|
||||
|
||||
<li>Serializer::attribute</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
64
|
||||
65
|
||||
66</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/attributes.rb', line 64</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid__attributes'>_attributes</span>
|
||||
<span class='id identifier rubyid__attributes_data'>_attributes_data</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="_attributes_keys-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>_attributes_keys</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
<p class="note private">
|
||||
<strong>This method is part of a private API.</strong>
|
||||
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
||||
</p>
|
||||
|
||||
<p>maps attribute value to explict key name</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
<p class="tag_title">See Also:</p>
|
||||
<ul class="see">
|
||||
|
||||
<li>Serializer::attribute</li>
|
||||
|
||||
<li>FragmentCache#fragment_serializer</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
72
|
||||
73
|
||||
74
|
||||
75
|
||||
76
|
||||
77
|
||||
78</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/attributes.rb', line 72</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid__attributes_keys'>_attributes_keys</span>
|
||||
<span class='id identifier rubyid__attributes_data'>_attributes_data</span>
|
||||
<span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_hash'>hash</span><span class='op'>|</span>
|
||||
<span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>==</span> <span class='id identifier rubyid_attr'>attr</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>key:</span> <span class='id identifier rubyid_key'>key</span> <span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="attribute-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>attribute</strong>(attr, options = {}, &block)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code>class AdminAuthorSerializer < ActiveModel::Serializer
|
||||
attributes :id, :recent_edits
|
||||
attribute :name, key: :title
|
||||
|
||||
attribute :full_name do
|
||||
"#{object.first_name} #{object.last_name}"
|
||||
end
|
||||
|
||||
def recent_edits
|
||||
object.edits.last(5)
|
||||
end</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
56
|
||||
57
|
||||
58
|
||||
59</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/attributes.rb', line 56</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_attribute'>attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:key</span><span class='comma'>,</span> <span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid__attributes_data'>_attributes_data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Attribute</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="attributes-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>attributes</strong>(*attrs)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code>class AdminAuthorSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :recent_edits</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
36
|
||||
37
|
||||
38
|
||||
39
|
||||
40
|
||||
41
|
||||
42</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/attributes.rb', line 36</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='kw'>if</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='const'>Array</span>
|
||||
|
||||
<span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attr'>attr</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_attribute'>attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="inherited-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>inherited</strong>(base)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
28
|
||||
29
|
||||
30
|
||||
31</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/attributes.rb', line 28</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_inherited'>inherited</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span>
|
||||
<span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid__attributes_data'>_attributes_data</span> <span class='op'>=</span> <span class='id identifier rubyid__attributes_data'>_attributes_data</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,176 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::BelongsToReflection
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/BelongsToReflection.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (B)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">BelongsToReflection</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::BelongsToReflection
|
||||
|
||||
|
||||
<span class="private note title">Private</span>
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="SingularReflection.html" title="ActiveModel::Serializer::SingularReflection (class)">SingularReflection</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">Struct</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="SingularReflection.html" title="ActiveModel::Serializer::SingularReflection (class)">SingularReflection</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::BelongsToReflection</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/belongs_to_reflection.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="docstring">
|
||||
<div class="discussion">
|
||||
<p class="note private">
|
||||
<strong>This class is part of a private API.</strong>
|
||||
You should avoid using this class if possible, as it may be removed or be changed in the future.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Field.html#block-instance_method" title="ActiveModel::Serializer::Field#block (method)">#block</a></span>, <span class='object_link'><a href="Field.html#name-instance_method" title="ActiveModel::Serializer::Field#name (method)">#name</a></span>, <span class='object_link'><a href="Field.html#options-instance_method" title="ActiveModel::Serializer::Field#options (method)">#options</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Method Summary</h2>
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Reflection.html#build_association-instance_method" title="ActiveModel::Serializer::Reflection#build_association (method)">#build_association</a></span>, <span class='object_link'><a href="Reflection.html#include_data-instance_method" title="ActiveModel::Serializer::Reflection#include_data (method)">#include_data</a></span>, <span class='object_link'><a href="Reflection.html#initialize-instance_method" title="ActiveModel::Serializer::Reflection#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Reflection.html#link-instance_method" title="ActiveModel::Serializer::Reflection#link (method)">#link</a></span>, <span class='object_link'><a href="Reflection.html#meta-instance_method" title="ActiveModel::Serializer::Reflection#meta (method)">#meta</a></span>, <span class='object_link'><a href="Reflection.html#value-instance_method" title="ActiveModel::Serializer::Reflection#value (method)">#value</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Reflection.html#initialize-instance_method" title="ActiveModel::Serializer::Reflection#initialize (method)">ActiveModel::Serializer::Reflection</a></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,638 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Caching
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Caching.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Caching</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Caching
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Concern</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Included in:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></dd>
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/caching.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Caching/ClassMethods.html" title="ActiveModel::Serializer::Caching::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<dl class="constants">
|
||||
|
||||
<dt id="CALLER_FILE-constant" class="">CALLER_FILE =
|
||||
<div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Matches</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>c:/git/emberjs/ember-crm-backend/app/serializers/lead_serializer.rb:1:in `<top (required)>'</span><span class='tstring_end'>"</span></span>
|
||||
<span class='const'>AND</span>
|
||||
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/c/git/emberjs/ember-crm-backend/app/serializers/lead_serializer.rb:1:in `<top (required)>'</span><span class='tstring_end'>"</span></span>
|
||||
<span class='const'>AS</span>
|
||||
<span class='id identifier rubyid_c'>c</span><span class='op'>/</span><span class='id identifier rubyid_git'>git</span><span class='op'>/</span><span class='id identifier rubyid_emberjs'>emberjs</span><span class='op'>/</span><span class='id identifier rubyid_ember'>ember</span><span class='op'>-</span><span class='id identifier rubyid_crm'>crm</span><span class='op'>-</span><span class='id identifier rubyid_backend'>backend</span><span class='op'>/</span><span class='id identifier rubyid_app'>app</span><span class='op'>/</span><span class='id identifier rubyid_serializers'>serializers</span><span class='op'>/</span><span class='id identifier rubyid_lead_serializer'>lead_serializer</span><span class='period'>.</span><span class='id identifier rubyid_rb'>rb</span>
|
||||
</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div>
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>
|
||||
\A # start of string
|
||||
.+ # file path (one or more characters)
|
||||
(?= # stop previous match when
|
||||
:\d+ # a colon is followed by one or more digits
|
||||
:in # followed by a colon followed by in
|
||||
)
|
||||
</span><span class='regexp_end'>/x</span></span></pre></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#cache_key-instance_method" title="#cache_key (instance method)">- (Object) <strong>cache_key</strong>(adapter_instance) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#fetch-instance_method" title="#fetch (instance method)">- (Object) <strong>fetch</strong>(adapter_instance, cache_options = serializer_class._cache_options) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#fetch_attributes-instance_method" title="#fetch_attributes (instance method)">- (Object) <strong>fetch_attributes</strong>(fields, cached_attributes, adapter_instance) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>INSTANCE METHODS.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#fetch_attributes_fragment-instance_method" title="#fetch_attributes_fragment (instance method)">- (Object) <strong>fetch_attributes_fragment</strong>(adapter_instance) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>1.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#object_cache_key-instance_method" title="#object_cache_key (instance method)">- (Object) <strong>object_cache_key</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Use object's cache_key if available, else derive a key from the object
|
||||
Pass the `key` option to the `cache` declaration or override this method to
|
||||
customize the cache key.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serializer_class-instance_method" title="#serializer_class (instance method)">- (Object) <strong>serializer_class</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="cache_key-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>cache_key</strong>(adapter_instance)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
256
|
||||
257
|
||||
258
|
||||
259
|
||||
260
|
||||
261
|
||||
262
|
||||
263
|
||||
264</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/caching.rb', line 256</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_cache_key'>cache_key</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='rparen'>)</span>
|
||||
<span class='kw'>return</span> <span class='ivar'>@cache_key</span> <span class='kw'>if</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='ivar'>@cache_key</span><span class='rparen'>)</span>
|
||||
|
||||
<span class='id identifier rubyid_parts'>parts</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
||||
<span class='id identifier rubyid_parts'>parts</span> <span class='op'><<</span> <span class='id identifier rubyid_object_cache_key'>object_cache_key</span>
|
||||
<span class='id identifier rubyid_parts'>parts</span> <span class='op'><<</span> <span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='period'>.</span><span class='id identifier rubyid_cache_key'>cache_key</span>
|
||||
<span class='id identifier rubyid_parts'>parts</span> <span class='op'><<</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid__cache_digest'>_cache_digest</span> <span class='kw'>unless</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid__skip_digest?'>_skip_digest?</span>
|
||||
<span class='ivar'>@cache_key</span> <span class='op'>=</span> <span class='id identifier rubyid_parts'>parts</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="fetch-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>fetch</strong>(adapter_instance, cache_options = serializer_class._cache_options)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
220
|
||||
221
|
||||
222
|
||||
223
|
||||
224
|
||||
225
|
||||
226
|
||||
227
|
||||
228</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/caching.rb', line 220</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='comma'>,</span> <span class='id identifier rubyid_cache_options'>cache_options</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid__cache_options'>_cache_options</span><span class='rparen'>)</span>
|
||||
<span class='kw'>if</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid_cache_store'>cache_store</span>
|
||||
<span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid_cache_store'>cache_store</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_cache_key'>cache_key</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_cache_options'>cache_options</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
||||
<span class='kw'>yield</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='kw'>yield</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="fetch_attributes-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>fetch_attributes</strong>(fields, cached_attributes, adapter_instance)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>INSTANCE METHODS</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
205
|
||||
206
|
||||
207
|
||||
208
|
||||
209
|
||||
210
|
||||
211
|
||||
212
|
||||
213
|
||||
214
|
||||
215
|
||||
216
|
||||
217
|
||||
218</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/caching.rb', line 205</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_attributes'>fetch_attributes</span><span class='lparen'>(</span><span class='id identifier rubyid_fields'>fields</span><span class='comma'>,</span> <span class='id identifier rubyid_cached_attributes'>cached_attributes</span><span class='comma'>,</span> <span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='rparen'>)</span>
|
||||
<span class='kw'>if</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid_cache_enabled?'>cache_enabled?</span>
|
||||
<span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_cache_key'>cache_key</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_cached_attributes'>cached_attributes</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid_cache_store'>cache_store</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid__cache_options'>_cache_options</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_attributes'>attributes</span><span class='lparen'>(</span><span class='id identifier rubyid_fields'>fields</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>elsif</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid_fragment_cache_enabled?'>fragment_cache_enabled?</span>
|
||||
<span class='id identifier rubyid_fetch_attributes_fragment'>fetch_attributes_fragment</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='rparen'>)</span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='id identifier rubyid_attributes'>attributes</span><span class='lparen'>(</span><span class='id identifier rubyid_fields'>fields</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="fetch_attributes_fragment-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>fetch_attributes_fragment</strong>(adapter_instance)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
<ol><li>
|
||||
<p>Determine cached fields from serializer class options</p>
|
||||
</li><li>
|
||||
<p>Get non_cached_fields and fetch cache_fields</p>
|
||||
</li><li>
|
||||
<p>Merge the two hashes using adapter_instance#fragment_cache</p>
|
||||
</li></ol>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
233
|
||||
234
|
||||
235
|
||||
236
|
||||
237
|
||||
238
|
||||
239
|
||||
240
|
||||
241
|
||||
242
|
||||
243
|
||||
244
|
||||
245
|
||||
246
|
||||
247
|
||||
248
|
||||
249
|
||||
250
|
||||
251
|
||||
252
|
||||
253
|
||||
254</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/caching.rb', line 233</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_attributes_fragment'>fetch_attributes_fragment</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid__cache_options'>_cache_options</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid__cache_options'>_cache_options</span><span class='lbracket'>[</span><span class='symbol'>:key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid__cache_key'>_cache_key</span> <span class='kw'>if</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid__cache_key'>_cache_key</span>
|
||||
<span class='id identifier rubyid_fields'>fields</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid_fragmented_attributes'>fragmented_attributes</span>
|
||||
|
||||
<span class='id identifier rubyid_non_cached_fields'>non_cached_fields</span> <span class='op'>=</span> <span class='id identifier rubyid_fields'>fields</span><span class='lbracket'>[</span><span class='symbol'>:non_cached</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
|
||||
<span class='id identifier rubyid_non_cached_hash'>non_cached_hash</span> <span class='op'>=</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='lparen'>(</span><span class='id identifier rubyid_non_cached_fields'>non_cached_fields</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_include_directive'>include_directive</span> <span class='op'>=</span> <span class='const'>JSONAPI</span><span class='op'>::</span><span class='const'>IncludeDirective</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_non_cached_fields'>non_cached_fields</span> <span class='op'>-</span> <span class='id identifier rubyid_non_cached_hash'>non_cached_hash</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_non_cached_hash'>non_cached_hash</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span> <span class='id identifier rubyid_resource_relationships'>resource_relationships</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>include_directive:</span> <span class='id identifier rubyid_include_directive'>include_directive</span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='rparen'>)</span>
|
||||
|
||||
<span class='id identifier rubyid_cached_fields'>cached_fields</span> <span class='op'>=</span> <span class='id identifier rubyid_fields'>fields</span><span class='lbracket'>[</span><span class='symbol'>:cached</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
|
||||
<span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_cache_key'>cache_key</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_cached_hash'>cached_hash</span> <span class='op'>=</span>
|
||||
<span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid_cache_store'>cache_store</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid__cache_options'>_cache_options</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='lparen'>(</span><span class='id identifier rubyid_cached_fields'>cached_fields</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_include_directive'>include_directive</span> <span class='op'>=</span> <span class='const'>JSONAPI</span><span class='op'>::</span><span class='const'>IncludeDirective</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_cached_fields'>cached_fields</span> <span class='op'>-</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span> <span class='id identifier rubyid_resource_relationships'>resource_relationships</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>include_directive:</span> <span class='id identifier rubyid_include_directive'>include_directive</span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
|
||||
<span class='comment'># Merge both results
|
||||
</span> <span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='period'>.</span><span class='id identifier rubyid_fragment_cache'>fragment_cache</span><span class='lparen'>(</span><span class='id identifier rubyid_cached_hash'>cached_hash</span><span class='comma'>,</span> <span class='id identifier rubyid_non_cached_hash'>non_cached_hash</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="object_cache_key-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>object_cache_key</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Use object's cache_key if available, else derive a key from the object
|
||||
Pass the `key` option to the `cache` declaration or override this method to
|
||||
customize the cache key</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
268
|
||||
269
|
||||
270
|
||||
271
|
||||
272
|
||||
273
|
||||
274
|
||||
275
|
||||
276
|
||||
277
|
||||
278</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/caching.rb', line 268</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_object_cache_key'>object_cache_key</span>
|
||||
<span class='kw'>if</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:cache_key</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_cache_key'>cache_key</span>
|
||||
<span class='kw'>elsif</span> <span class='lparen'>(</span><span class='id identifier rubyid_serializer_cache_key'>serializer_cache_key</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid__cache_key'>_cache_key</span> <span class='op'>||</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid__cache_options'>_cache_options</span><span class='lbracket'>[</span><span class='symbol'>:key</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_object_time_safe'>object_time_safe</span> <span class='op'>=</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_updated_at'>updated_at</span>
|
||||
<span class='id identifier rubyid_object_time_safe'>object_time_safe</span> <span class='op'>=</span> <span class='id identifier rubyid_object_time_safe'>object_time_safe</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%Y%m%d%H%M%S%9N</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_object_time_safe'>object_time_safe</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:strftime</span><span class='rparen'>)</span>
|
||||
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_serializer_cache_key'>serializer_cache_key</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>-</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_object_time_safe'>object_time_safe</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='id identifier rubyid_fail'>fail</span> <span class='const'>UndefinedCacheKey</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_content'> must define #cache_key, or the 'key:' option must be passed into '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='embexpr_end'>}</span><span class='tstring_content'>.cache'</span><span class='tstring_end'>"</span></span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serializer_class-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serializer_class</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
280
|
||||
281
|
||||
282</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/caching.rb', line 280</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span>
|
||||
<span class='ivar'>@serializer_class</span> <span class='op'>||=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,172 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::CollectionReflection
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/CollectionReflection.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">CollectionReflection</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::CollectionReflection
|
||||
|
||||
|
||||
<span class="private note title">Private</span>
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">Struct</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::CollectionReflection</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/collection_reflection.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="docstring">
|
||||
<div class="discussion">
|
||||
<p class="note private">
|
||||
<strong>This class is part of a private API.</strong>
|
||||
You should avoid using this class if possible, as it may be removed or be changed in the future.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><div id="subclasses">
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class="children"><span class='object_link'><a href="HasManyReflection.html" title="ActiveModel::Serializer::HasManyReflection (class)">HasManyReflection</a></span></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Field.html#block-instance_method" title="ActiveModel::Serializer::Field#block (method)">#block</a></span>, <span class='object_link'><a href="Field.html#name-instance_method" title="ActiveModel::Serializer::Field#name (method)">#name</a></span>, <span class='object_link'><a href="Field.html#options-instance_method" title="ActiveModel::Serializer::Field#options (method)">#options</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Method Summary</h2>
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Reflection.html#build_association-instance_method" title="ActiveModel::Serializer::Reflection#build_association (method)">#build_association</a></span>, <span class='object_link'><a href="Reflection.html#include_data-instance_method" title="ActiveModel::Serializer::Reflection#include_data (method)">#include_data</a></span>, <span class='object_link'><a href="Reflection.html#initialize-instance_method" title="ActiveModel::Serializer::Reflection#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Reflection.html#link-instance_method" title="ActiveModel::Serializer::Reflection#link (method)">#link</a></span>, <span class='object_link'><a href="Reflection.html#meta-instance_method" title="ActiveModel::Serializer::Reflection#meta (method)">#meta</a></span>, <span class='object_link'><a href="Reflection.html#value-instance_method" title="ActiveModel::Serializer::Reflection#value (method)">#value</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Reflection.html#initialize-instance_method" title="ActiveModel::Serializer::Reflection#initialize (method)">ActiveModel::Serializer::Reflection</a></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,712 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::CollectionSerializer
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/CollectionSerializer.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">CollectionSerializer</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::CollectionSerializer
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::CollectionSerializer</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Includes:</dt>
|
||||
<dd class="r2">Enumerable</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/collection_serializer.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div id="subclasses">
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class="children"><span class='object_link'><a href="ArraySerializer.html" title="ActiveModel::Serializer::ArraySerializer (class)">ArraySerializer</a></span></p>
|
||||
</div>
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<dl class="constants">
|
||||
|
||||
<dt id="NoSerializerError-constant" class="">NoSerializerError =
|
||||
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>StandardError</span><span class='rparen'>)</span></pre></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#object-instance_method" title="#object (instance method)">- (Object) <strong>object</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute object.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#root-instance_method" title="#root (instance method)">- (Object) <strong>root</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute root.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (CollectionSerializer) <strong>initialize</strong>(resources, options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of CollectionSerializer.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#json_key-instance_method" title="#json_key (instance method)">- (Object) <strong>json_key</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>TODO: unify naming of root, json_key, and _type.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#paginated%3F-instance_method" title="#paginated? (instance method)">- (Boolean) <strong>paginated?</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>rubocop:enable Metrics/CyclomaticComplexity.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serializable_hash-instance_method" title="#serializable_hash (instance method)">- (Object) <strong>serializable_hash</strong>(adapter_options, options, adapter_instance) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="private note title">private</span>
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#success%3F-instance_method" title="#success? (instance method)">- (Boolean) <strong>success?</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModel::Serializer::CollectionSerializer (class)">CollectionSerializer</a></span></tt>) <strong>initialize</strong>(resources, options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of CollectionSerializer</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/collection_serializer.rb', line 10</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_resources'>resources</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@object</span> <span class='op'>=</span> <span class='id identifier rubyid_resources'>resources</span>
|
||||
<span class='ivar'>@options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span>
|
||||
<span class='ivar'>@root</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:root</span><span class='rbracket'>]</span>
|
||||
<span class='ivar'>@serializers</span> <span class='op'>=</span> <span class='id identifier rubyid_serializers_from_resources'>serializers_from_resources</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="instance_attr_details" class="attr_details">
|
||||
<h2>Instance Attribute Details</h2>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="object-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>object</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute object</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
8
|
||||
9
|
||||
10</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/collection_serializer.rb', line 8</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_object'>object</span>
|
||||
<span class='ivar'>@object</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="root-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>root</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute root</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
8
|
||||
9
|
||||
10</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/collection_serializer.rb', line 8</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_root'>root</span>
|
||||
<span class='ivar'>@root</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="json_key-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>json_key</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>TODO: unify naming of root, json_key, and _type. Right now, a
|
||||
serializer's json_key comes from the root option or the object's
|
||||
model name, by default. But, if a dev defines a custom `json_key` method
|
||||
with an explicit value, we have no simple way to know that it is safe to
|
||||
call that instance method. (which is really a class property at this point,
|
||||
anyhow). rubocop:disable Metrics/CyclomaticComplexity Disabling cop since
|
||||
it's good to highlight the complexity of this method by including all
|
||||
the logic right here.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
39
|
||||
40
|
||||
41
|
||||
42
|
||||
43
|
||||
44
|
||||
45
|
||||
46
|
||||
47
|
||||
48
|
||||
49
|
||||
50
|
||||
51</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/collection_serializer.rb', line 39</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_json_key'>json_key</span>
|
||||
<span class='kw'>return</span> <span class='id identifier rubyid_root'>root</span> <span class='kw'>if</span> <span class='id identifier rubyid_root'>root</span>
|
||||
<span class='comment'># 1. get from options[:serializer] for empty resource collection
|
||||
</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>&&</span>
|
||||
<span class='lparen'>(</span><span class='id identifier rubyid_explicit_serializer_class'>explicit_serializer_class</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:serializer</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>&&</span>
|
||||
<span class='id identifier rubyid_explicit_serializer_class'>explicit_serializer_class</span><span class='period'>.</span><span class='id identifier rubyid__type'>_type</span>
|
||||
<span class='comment'># 2. get from first serializer instance in collection
|
||||
</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>||=</span> <span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span> <span class='op'>=</span> <span class='id identifier rubyid_serializers'>serializers</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_json_key'>json_key</span>
|
||||
<span class='comment'># 3. get from collection name, if a named collection
|
||||
</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>||=</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:name</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
||||
<span class='comment'># 4. key may be nil for empty collection and no serializer option
|
||||
</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>&&</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_pluralize'>pluralize</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="paginated?-instance_method">
|
||||
|
||||
- (<tt>Boolean</tt>) <strong>paginated?</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>rubocop:enable Metrics/CyclomaticComplexity</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
54
|
||||
55
|
||||
56
|
||||
57
|
||||
58</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/collection_serializer.rb', line 54</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_paginated?'>paginated?</span>
|
||||
<span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:current_page</span><span class='rparen'>)</span> <span class='op'>&&</span>
|
||||
<span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:total_pages</span><span class='rparen'>)</span> <span class='op'>&&</span>
|
||||
<span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:size</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serializable_hash-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serializable_hash</strong>(adapter_options, options, adapter_instance)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
<p class="note private">
|
||||
<strong>This method is part of a private API.</strong>
|
||||
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26
|
||||
27
|
||||
28
|
||||
29</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/collection_serializer.rb', line 22</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serializable_hash'>serializable_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_options'>adapter_options</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_include_directive'>include_directive</span> <span class='op'>=</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span><span class='period'>.</span><span class='id identifier rubyid_include_directive_from_options'>include_directive_from_options</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_options'>adapter_options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_adapter_options'>adapter_options</span><span class='lbracket'>[</span><span class='symbol'>:cached_attributes</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span><span class='period'>.</span><span class='id identifier rubyid_cache_read_multi'>cache_read_multi</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='comma'>,</span> <span class='id identifier rubyid_include_directive'>include_directive</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_adapter_opts'>adapter_opts</span> <span class='op'>=</span> <span class='id identifier rubyid_adapter_options'>adapter_options</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='label'>include_directive:</span> <span class='id identifier rubyid_include_directive'>include_directive</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serializers'>serializers</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_serializer'>serializer</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_serializable_hash'>serializable_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_opts'>adapter_opts</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_adapter_instance'>adapter_instance</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="success?-instance_method">
|
||||
|
||||
- (<tt>Boolean</tt>) <strong>success?</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
17
|
||||
18
|
||||
19</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/collection_serializer.rb', line 17</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_success?'>success?</span>
|
||||
<span class='kw'>true</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,119 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Configuration
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Configuration.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Configuration</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Configuration
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Concern</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Includes:</dt>
|
||||
<dd class="r2">ActiveSupport::Configurable</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Included in:</dt>
|
||||
<dd class="r1"><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></dd>
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/configuration.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,396 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::ErrorSerializer
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/ErrorSerializer.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (E)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">ErrorSerializer</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::ErrorSerializer
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::ErrorSerializer</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/error_serializer.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<h3 class="inherited">Constants inherited
|
||||
from <span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../Serializer.html#SERIALIZABLE_HASH_VALID_KEYS-constant" title="ActiveModel::Serializer::SERIALIZABLE_HASH_VALID_KEYS (constant)">SERIALIZABLE_HASH_VALID_KEYS</a></span>, <span class='object_link'><a href="../Serializer.html#UndefinedCacheKey-constant" title="ActiveModel::Serializer::UndefinedCacheKey (constant)">UndefinedCacheKey</a></span>, <span class='object_link'><a href="../Serializer.html#VERSION-constant" title="ActiveModel::Serializer::VERSION (constant)">VERSION</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Constants included
|
||||
from <span class='object_link'><a href="Caching.html" title="ActiveModel::Serializer::Caching (module)">Caching</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Caching.html#CALLER_FILE-constant" title="ActiveModel::Serializer::Caching::CALLER_FILE (constant)">Caching::CALLER_FILE</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../Serializer.html#object-instance_method" title="ActiveModel::Serializer#object (method)">#object</a></span>, <span class='object_link'><a href="../Serializer.html#root-instance_method" title="ActiveModel::Serializer#root (method)">#root</a></span>, <span class='object_link'><a href="../Serializer.html#scope-instance_method" title="ActiveModel::Serializer#scope (method)">#scope</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#as_json-instance_method" title="#as_json (instance method)">- (Hash<field_name,Array<error_message>>) <strong>as_json</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#success%3F-instance_method" title="#success? (instance method)">- (Boolean) <strong>success?</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../Serializer.html#adapter-class_method" title="ActiveModel::Serializer.adapter (method)">adapter</a></span>, <span class='object_link'><a href="../Serializer.html#get_serializer_for-class_method" title="ActiveModel::Serializer.get_serializer_for (method)">get_serializer_for</a></span>, <span class='object_link'><a href="../Serializer.html#include_directive_from_options-class_method" title="ActiveModel::Serializer.include_directive_from_options (method)">include_directive_from_options</a></span>, <span class='object_link'><a href="../Serializer.html#initialize-instance_method" title="ActiveModel::Serializer#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="../Serializer.html#json_key-instance_method" title="ActiveModel::Serializer#json_key (method)">#json_key</a></span>, <span class='object_link'><a href="../Serializer.html#read_attribute_for_serialization-instance_method" title="ActiveModel::Serializer#read_attribute_for_serialization (method)">#read_attribute_for_serialization</a></span>, <span class='object_link'><a href="../Serializer.html#relationship_value_for-instance_method" title="ActiveModel::Serializer#relationship_value_for (method)">#relationship_value_for</a></span>, <span class='object_link'><a href="../Serializer.html#resource_relationships-instance_method" title="ActiveModel::Serializer#resource_relationships (method)">#resource_relationships</a></span>, <span class='object_link'><a href="../Serializer.html#serializable_hash-instance_method" title="ActiveModel::Serializer#serializable_hash (method)">#serializable_hash</a></span>, <span class='object_link'><a href="../Serializer.html#serialization_adapter_instance-class_method" title="ActiveModel::Serializer.serialization_adapter_instance (method)">serialization_adapter_instance</a></span>, <span class='object_link'><a href="../Serializer.html#serializer_for-class_method" title="ActiveModel::Serializer.serializer_for (method)">serializer_for</a></span>, <span class='object_link'><a href="../Serializer.html#serializer_lookup_chain_for-class_method" title="ActiveModel::Serializer.serializer_lookup_chain_for (method)">serializer_lookup_chain_for</a></span>, <span class='object_link'><a href="../Serializer.html#serializers_cache-class_method" title="ActiveModel::Serializer.serializers_cache (method)">serializers_cache</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html#delegate_and_deprecate-class_method" title="ActiveModelSerializers::Deprecate.delegate_and_deprecate (method)">delegate_and_deprecate</a></span>, <span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html#deprecate-class_method" title="ActiveModelSerializers::Deprecate.deprecate (method)">deprecate</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="Caching.html" title="ActiveModel::Serializer::Caching (module)">Caching</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Caching.html#cache_key-instance_method" title="ActiveModel::Serializer::Caching#cache_key (method)">#cache_key</a></span>, <span class='object_link'><a href="Caching.html#fetch-instance_method" title="ActiveModel::Serializer::Caching#fetch (method)">#fetch</a></span>, <span class='object_link'><a href="Caching.html#fetch_attributes-instance_method" title="ActiveModel::Serializer::Caching#fetch_attributes (method)">#fetch_attributes</a></span>, <span class='object_link'><a href="Caching.html#fetch_attributes_fragment-instance_method" title="ActiveModel::Serializer::Caching#fetch_attributes_fragment (method)">#fetch_attributes_fragment</a></span>, <span class='object_link'><a href="Caching.html#object_cache_key-instance_method" title="ActiveModel::Serializer::Caching#object_cache_key (method)">#object_cache_key</a></span>, <span class='object_link'><a href="Caching.html#serializer_class-instance_method" title="ActiveModel::Serializer::Caching#serializer_class (method)">#serializer_class</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="Associations.html" title="ActiveModel::Serializer::Associations (module)">Associations</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Associations.html#associations-instance_method" title="ActiveModel::Serializer::Associations#associations (method)">#associations</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="../Serializer.html#initialize-instance_method" title="ActiveModel::Serializer#initialize (method)">ActiveModel::Serializer</a></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="as_json-instance_method">
|
||||
|
||||
- (<tt>Hash<field_name,Array<error_message>></tt>) <strong>as_json</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Hash<field_name,Array<error_message>></tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
3
|
||||
4
|
||||
5</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/error_serializer.rb', line 3</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span>
|
||||
<span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_messages'>messages</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="success?-instance_method">
|
||||
|
||||
- (<tt>Boolean</tt>) <strong>success?</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
7
|
||||
8
|
||||
9</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/error_serializer.rb', line 7</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_success?'>success?</span>
|
||||
<span class='kw'>false</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,503 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::ErrorsSerializer
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/ErrorsSerializer.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (E)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">ErrorsSerializer</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::ErrorsSerializer
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::ErrorsSerializer</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Includes:</dt>
|
||||
<dd class="r2">Enumerable</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/errors_serializer.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#object-instance_method" title="#object (instance method)">- (Object) <strong>object</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute object.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#root-instance_method" title="#root (instance method)">- (Object) <strong>root</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute root.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (ErrorsSerializer) <strong>initialize</strong>(resources, options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of ErrorsSerializer.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#json_key-instance_method" title="#json_key (instance method)">- (Object) <strong>json_key</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#success%3F-instance_method" title="#success? (instance method)">- (Boolean) <strong>success?</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModel::Serializer::ErrorsSerializer (class)">ErrorsSerializer</a></span></tt>) <strong>initialize</strong>(resources, options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of ErrorsSerializer</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/errors_serializer.rb', line 7</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_resources'>resources</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@root</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:root</span><span class='rbracket'>]</span>
|
||||
<span class='ivar'>@object</span> <span class='op'>=</span> <span class='id identifier rubyid_resources'>resources</span>
|
||||
<span class='ivar'>@serializers</span> <span class='op'>=</span> <span class='id identifier rubyid_resources'>resources</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_resource'>resource</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_serializer_class'>serializer_class</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:serializer</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span><span class='op'>::</span><span class='const'>ErrorSerializer</span> <span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_except'>except</span><span class='lparen'>(</span><span class='symbol'>:serializer</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="instance_attr_details" class="attr_details">
|
||||
<h2>Instance Attribute Details</h2>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="object-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>object</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute object</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
5
|
||||
6
|
||||
7</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/errors_serializer.rb', line 5</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_object'>object</span>
|
||||
<span class='ivar'>@object</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="root-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>root</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute root</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
5
|
||||
6
|
||||
7</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/errors_serializer.rb', line 5</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_root'>root</span>
|
||||
<span class='ivar'>@root</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="json_key-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>json_key</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
20
|
||||
21
|
||||
22</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/errors_serializer.rb', line 20</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_json_key'>json_key</span>
|
||||
<span class='kw'>nil</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="success?-instance_method">
|
||||
|
||||
- (<tt>Boolean</tt>) <strong>success?</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
16
|
||||
17
|
||||
18</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/errors_serializer.rb', line 16</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_success?'>success?</span>
|
||||
<span class='kw'>false</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,414 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::Field
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Field.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (F)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Field</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::Field
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Struct</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">Struct</li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::Field</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/field.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Holds all the meta-data about a field (i.e. attribute or association) as it
|
||||
was specified in the ActiveModel::Serializer class. Notice that the field
|
||||
block is evaluated in the context of the serializer.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><div id="subclasses">
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class="children"><span class='object_link'><a href="Attribute.html" title="ActiveModel::Serializer::Attribute (class)">Attribute</a></span>, <span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#block-instance_method" title="#block (instance method)">- (Object) <strong>block</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute block.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#name-instance_method" title="#name (instance method)">- (Object) <strong>name</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute name.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#options-instance_method" title="#options (instance method)">- (Object) <strong>options</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute options.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_attr_details" class="attr_details">
|
||||
<h2>Instance Attribute Details</h2>
|
||||
|
||||
|
||||
<span id="block=-instance_method"></span>
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="block-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>block</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute block</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Object</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>the current value of block</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
6
|
||||
7
|
||||
8</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/field.rb', line 6</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_block'>block</span>
|
||||
<span class='ivar'>@block</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id="name=-instance_method"></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="name-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>name</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute name</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Object</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>the current value of name</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
6
|
||||
7
|
||||
8</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/field.rb', line 6</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
|
||||
<span class='ivar'>@name</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id="options=-instance_method"></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="options-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>options</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute options</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Object</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>the current value of options</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
6
|
||||
7
|
||||
8</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/field.rb', line 6</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span>
|
||||
<span class='ivar'>@options</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:38 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,312 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::Fieldset
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Fieldset.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (F)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Fieldset</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::Fieldset
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::Fieldset</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/fieldset.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#fields-instance_method" title="#fields (instance method)">- (Object) <strong>fields</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#fields_for-instance_method" title="#fields_for (instance method)">- (Object) <strong>fields_for</strong>(type) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Fieldset) <strong>initialize</strong>(fields) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of Fieldset.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModel::Serializer::Fieldset (class)">Fieldset</a></span></tt>) <strong>initialize</strong>(fields)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of Fieldset</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
4
|
||||
5
|
||||
6</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/fieldset.rb', line 4</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_fields'>fields</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@raw_fields</span> <span class='op'>=</span> <span class='id identifier rubyid_fields'>fields</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="fields-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>fields</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
8
|
||||
9
|
||||
10</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/fieldset.rb', line 8</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_fields'>fields</span>
|
||||
<span class='ivar'>@fields</span> <span class='op'>||=</span> <span class='id identifier rubyid_parsed_fields'>parsed_fields</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="fields_for-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>fields_for</strong>(type)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
12
|
||||
13
|
||||
14</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/fieldset.rb', line 12</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_fields_for'>fields_for</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_fields'>fields</span><span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_singularize'>singularize</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_fields'>fields</span><span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_pluralize'>pluralize</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:38 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,176 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::HasManyReflection
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/HasManyReflection.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (H)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">HasManyReflection</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::HasManyReflection
|
||||
|
||||
|
||||
<span class="private note title">Private</span>
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="CollectionReflection.html" title="ActiveModel::Serializer::CollectionReflection (class)">CollectionReflection</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">Struct</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="CollectionReflection.html" title="ActiveModel::Serializer::CollectionReflection (class)">CollectionReflection</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::HasManyReflection</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/has_many_reflection.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="docstring">
|
||||
<div class="discussion">
|
||||
<p class="note private">
|
||||
<strong>This class is part of a private API.</strong>
|
||||
You should avoid using this class if possible, as it may be removed or be changed in the future.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Field.html#block-instance_method" title="ActiveModel::Serializer::Field#block (method)">#block</a></span>, <span class='object_link'><a href="Field.html#name-instance_method" title="ActiveModel::Serializer::Field#name (method)">#name</a></span>, <span class='object_link'><a href="Field.html#options-instance_method" title="ActiveModel::Serializer::Field#options (method)">#options</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Method Summary</h2>
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Reflection.html#build_association-instance_method" title="ActiveModel::Serializer::Reflection#build_association (method)">#build_association</a></span>, <span class='object_link'><a href="Reflection.html#include_data-instance_method" title="ActiveModel::Serializer::Reflection#include_data (method)">#include_data</a></span>, <span class='object_link'><a href="Reflection.html#initialize-instance_method" title="ActiveModel::Serializer::Reflection#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Reflection.html#link-instance_method" title="ActiveModel::Serializer::Reflection#link (method)">#link</a></span>, <span class='object_link'><a href="Reflection.html#meta-instance_method" title="ActiveModel::Serializer::Reflection#meta (method)">#meta</a></span>, <span class='object_link'><a href="Reflection.html#value-instance_method" title="ActiveModel::Serializer::Reflection#value (method)">#value</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Reflection.html#initialize-instance_method" title="ActiveModel::Serializer::Reflection#initialize (method)">ActiveModel::Serializer::Reflection</a></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,176 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::HasOneReflection
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/HasOneReflection.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (H)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">HasOneReflection</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::HasOneReflection
|
||||
|
||||
|
||||
<span class="private note title">Private</span>
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="SingularReflection.html" title="ActiveModel::Serializer::SingularReflection (class)">SingularReflection</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">Struct</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="SingularReflection.html" title="ActiveModel::Serializer::SingularReflection (class)">SingularReflection</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::HasOneReflection</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/has_one_reflection.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="docstring">
|
||||
<div class="discussion">
|
||||
<p class="note private">
|
||||
<strong>This class is part of a private API.</strong>
|
||||
You should avoid using this class if possible, as it may be removed or be changed in the future.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Field.html#block-instance_method" title="ActiveModel::Serializer::Field#block (method)">#block</a></span>, <span class='object_link'><a href="Field.html#name-instance_method" title="ActiveModel::Serializer::Field#name (method)">#name</a></span>, <span class='object_link'><a href="Field.html#options-instance_method" title="ActiveModel::Serializer::Field#options (method)">#options</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Method Summary</h2>
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Reflection.html#build_association-instance_method" title="ActiveModel::Serializer::Reflection#build_association (method)">#build_association</a></span>, <span class='object_link'><a href="Reflection.html#include_data-instance_method" title="ActiveModel::Serializer::Reflection#include_data (method)">#include_data</a></span>, <span class='object_link'><a href="Reflection.html#initialize-instance_method" title="ActiveModel::Serializer::Reflection#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Reflection.html#link-instance_method" title="ActiveModel::Serializer::Reflection#link (method)">#link</a></span>, <span class='object_link'><a href="Reflection.html#meta-instance_method" title="ActiveModel::Serializer::Reflection#meta (method)">#meta</a></span>, <span class='object_link'><a href="Reflection.html#value-instance_method" title="ActiveModel::Serializer::Reflection#value (method)">#value</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Reflection.html#initialize-instance_method" title="ActiveModel::Serializer::Reflection#initialize (method)">ActiveModel::Serializer::Reflection</a></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,124 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Links
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Links.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (L)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Links</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Links
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Concern</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Included in:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></dd>
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/links.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Links/ClassMethods.html" title="ActiveModel::Serializer::Links::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:35 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,255 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Links::ClassMethods
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModel/Serializer/Links/ClassMethods.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span> » <span class='title'><span class='object_link'><a href="../Links.html" title="ActiveModel::Serializer::Links (module)">Links</a></span></span>
|
||||
»
|
||||
<span class="title">ClassMethods</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Links::ClassMethods
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/links.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#inherited-instance_method" title="#inherited (instance method)">- (Object) <strong>inherited</strong>(base) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#link-instance_method" title="#link (instance method)">- (Object) <strong>link</strong>(name, value = nil, &block) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Define a link on a serializer.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="inherited-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>inherited</strong>(base)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
16
|
||||
17
|
||||
18
|
||||
19</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/links.rb', line 16</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_inherited'>inherited</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span>
|
||||
<span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid__links'>_links</span> <span class='op'>=</span> <span class='id identifier rubyid__links'>_links</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="link-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>link</strong>(name, value = nil, &block)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Define a link on a serializer.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='id identifier rubyid_link'>link</span><span class='lparen'>(</span><span class='symbol'>:self</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_resource_url'>resource_url</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='rparen'>)</span> <span class='rbrace'>}</span></code></pre>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='id identifier rubyid_link'>link</span><span class='lparen'>(</span><span class='symbol'>:self</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>http://example.com/resource/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span></code></pre>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='id identifier rubyid_link'>link</span> <span class='symbol'>:resource</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>http://example.com/resource</span><span class='tstring_end'>"</span></span></code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
29
|
||||
30
|
||||
31</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/links.rb', line 29</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_link'>link</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid__links'>_links</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span> <span class='op'>||</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,115 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Lint
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Lint.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (L)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Lint</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Lint
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/lint.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Lint/Tests.html" title="ActiveModel::Serializer::Lint::Tests (module)">Tests</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:35 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,910 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Lint::Tests
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModel/Serializer/Lint/Tests.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (T)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span> » <span class='title'><span class='object_link'><a href="../Lint.html" title="ActiveModel::Serializer::Lint (module)">Lint</a></span></span>
|
||||
»
|
||||
<span class="title">Tests</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Lint::Tests
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/lint.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<h2 id="label-Active+Model+Serializer+Lint+Tests">Active Model Serializer Lint Tests</h2>
|
||||
|
||||
<p>You can test whether an object is compliant with the Active Model
|
||||
Serializers API by including
|
||||
<code>ActiveModel::Serializer::Lint::Tests</code> in your TestCase. It will
|
||||
include tests that tell you whether your object is fully compliant, or if
|
||||
not, which aspects of the API are not implemented.</p>
|
||||
|
||||
<p>Note an object is not required to implement all APIs in order to work with
|
||||
Active Model Serializers. This module only intends to provide guidance in
|
||||
case you want all features out of the box.</p>
|
||||
|
||||
<p>These tests do not attempt to determine the semantic correctness of the
|
||||
returned values. For instance, you could implement
|
||||
<code>serializable_hash</code> to always return <tt>{}</tt>, and the tests would
|
||||
pass. It is up to you to ensure that the values are semantically
|
||||
meaningful.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#test_active_model_errors-instance_method" title="#test_active_model_errors (instance method)">- (Object) <strong>test_active_model_errors</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#test_active_model_errors_human_attribute_name-instance_method" title="#test_active_model_errors_human_attribute_name (instance method)">- (Object) <strong>test_active_model_errors_human_attribute_name</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#test_active_model_errors_lookup_ancestors-instance_method" title="#test_active_model_errors_lookup_ancestors (instance method)">- (Object) <strong>test_active_model_errors_lookup_ancestors</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#test_as_json-instance_method" title="#test_as_json (instance method)">- (Object) <strong>test_as_json</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Passes if the object responds to as_json and if it takes zero or one
|
||||
arguments.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#test_cache_key-instance_method" title="#test_cache_key (instance method)">- (Object) <strong>test_cache_key</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Passes if the object responds to cache_key Fails otherwise.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#test_id-instance_method" title="#test_id (instance method)">- (Object) <strong>test_id</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Passes if the object responds to id and if it takes no arguments.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#test_model_name-instance_method" title="#test_model_name (instance method)">- (Object) <strong>test_model_name</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Passes if the object's class responds to model_name and if it is in an
|
||||
instance of <code>ActiveModel::Name</code>.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#test_read_attribute_for_serialization-instance_method" title="#test_read_attribute_for_serialization (instance method)">- (Object) <strong>test_read_attribute_for_serialization</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Passes if the object responds to read_attribute_for_serialization and if it
|
||||
requires one argument (the attribute to be read).</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#test_serializable_hash-instance_method" title="#test_serializable_hash (instance method)">- (Object) <strong>test_serializable_hash</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Passes if the object responds to serializable_hash and if it takes zero or
|
||||
one arguments.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#test_to_json-instance_method" title="#test_to_json (instance method)">- (Object) <strong>test_to_json</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Passes if the object responds to to_json and if it takes zero or one
|
||||
arguments.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#test_updated_at-instance_method" title="#test_updated_at (instance method)">- (Object) <strong>test_updated_at</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Passes if the object responds to updated_at and if it takes no arguments.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="test_active_model_errors-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>test_active_model_errors</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
122
|
||||
123
|
||||
124</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/lint.rb', line 122</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_test_active_model_errors'>test_active_model_errors</span>
|
||||
<span class='id identifier rubyid_assert_respond_to'>assert_respond_to</span> <span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='symbol'>:errors</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="test_active_model_errors_human_attribute_name-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>test_active_model_errors_human_attribute_name</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
126
|
||||
127
|
||||
128
|
||||
129</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/lint.rb', line 126</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_test_active_model_errors_human_attribute_name'>test_active_model_errors_human_attribute_name</span>
|
||||
<span class='id identifier rubyid_assert_respond_to'>assert_respond_to</span> <span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='comma'>,</span> <span class='symbol'>:human_attribute_name</span>
|
||||
<span class='id identifier rubyid_assert_equal'>assert_equal</span><span class='lparen'>(</span><span class='op'>-</span><span class='int'>2</span><span class='comma'>,</span> <span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:human_attribute_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_arity'>arity</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="test_active_model_errors_lookup_ancestors-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>test_active_model_errors_lookup_ancestors</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
131
|
||||
132
|
||||
133
|
||||
134</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/lint.rb', line 131</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_test_active_model_errors_lookup_ancestors'>test_active_model_errors_lookup_ancestors</span>
|
||||
<span class='id identifier rubyid_assert_respond_to'>assert_respond_to</span> <span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='comma'>,</span> <span class='symbol'>:lookup_ancestors</span>
|
||||
<span class='id identifier rubyid_assert_equal'>assert_equal</span> <span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:lookup_ancestors</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_arity'>arity</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="test_as_json-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>test_as_json</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Passes if the object responds to <code>as_json</code> and if it takes zero
|
||||
or one arguments. Fails otherwise.</p>
|
||||
|
||||
<p><code>as_json</code> returns a hash representation of a serialized object.
|
||||
It may delegate to <code>serializable_hash</code> Typically, it is
|
||||
implemented either by including ActiveModel::Serialization which includes
|
||||
ActiveModel::Serializers::JSON. or by the JSON gem when required.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
54
|
||||
55
|
||||
56
|
||||
57
|
||||
58</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/lint.rb', line 54</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_test_as_json'>test_as_json</span>
|
||||
<span class='id identifier rubyid_assert_respond_to'>assert_respond_to</span> <span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='symbol'>:as_json</span>
|
||||
<span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_as_json'>as_json</span>
|
||||
<span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_as_json'>as_json</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="test_cache_key-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>test_cache_key</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Passes if the object responds to <code>cache_key</code> Fails otherwise.</p>
|
||||
|
||||
<p><code>cache_key</code> returns a (self-expiring) unique key for the object,
|
||||
and is part of the (self-expiring) cache_key, which is used by the adapter.
|
||||
It is not required unless caching is enabled.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
79
|
||||
80
|
||||
81
|
||||
82
|
||||
83</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/lint.rb', line 79</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_test_cache_key'>test_cache_key</span>
|
||||
<span class='id identifier rubyid_assert_respond_to'>assert_respond_to</span> <span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='symbol'>:cache_key</span>
|
||||
<span class='id identifier rubyid_actual_arity'>actual_arity</span> <span class='op'>=</span> <span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:cache_key</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_arity'>arity</span>
|
||||
<span class='id identifier rubyid_assert_includes'>assert_includes</span> <span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_actual_arity'>actual_arity</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>expected </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_actual_arity'>actual_arity</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'> to be 0 or -1</span><span class='tstring_end'>"</span></span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="test_id-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>test_id</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Passes if the object responds to <code>id</code> and if it takes no
|
||||
arguments. Fails otherwise.</p>
|
||||
|
||||
<p><code>id</code> returns a unique identifier for the object. It is not
|
||||
required unless caching is enabled.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
104
|
||||
105
|
||||
106
|
||||
107</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/lint.rb', line 104</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_test_id'>test_id</span>
|
||||
<span class='id identifier rubyid_assert_respond_to'>assert_respond_to</span> <span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='symbol'>:id</span>
|
||||
<span class='id identifier rubyid_assert_equal'>assert_equal</span> <span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_arity'>arity</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="test_model_name-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>test_model_name</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Passes if the object's class responds to <code>model_name</code> and if
|
||||
it is in an instance of <code>ActiveModel::Name</code>. Fails otherwise.</p>
|
||||
|
||||
<p><code>model_name</code> returns an ActiveModel::Name instance. It is used
|
||||
by the serializer to identify the object's type. It is not required
|
||||
unless caching is enabled.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
116
|
||||
117
|
||||
118
|
||||
119
|
||||
120</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/lint.rb', line 116</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_test_model_name'>test_model_name</span>
|
||||
<span class='id identifier rubyid_resource_class'>resource_class</span> <span class='op'>=</span> <span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span>
|
||||
<span class='id identifier rubyid_assert_respond_to'>assert_respond_to</span> <span class='id identifier rubyid_resource_class'>resource_class</span><span class='comma'>,</span> <span class='symbol'>:model_name</span>
|
||||
<span class='id identifier rubyid_assert_instance_of'>assert_instance_of</span> <span class='id identifier rubyid_resource_class'>resource_class</span><span class='period'>.</span><span class='id identifier rubyid_model_name'>model_name</span><span class='comma'>,</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Name</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="test_read_attribute_for_serialization-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>test_read_attribute_for_serialization</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Passes if the object responds to
|
||||
<code>read_attribute_for_serialization</code> and if it requires one
|
||||
argument (the attribute to be read). Fails otherwise.</p>
|
||||
|
||||
<p><code>read_attribute_for_serialization</code> gets the attribute value for
|
||||
serialization Typically, it is implemented by including
|
||||
ActiveModel::Serialization.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
36
|
||||
37
|
||||
38
|
||||
39
|
||||
40
|
||||
41
|
||||
42
|
||||
43</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/lint.rb', line 36</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_test_read_attribute_for_serialization'>test_read_attribute_for_serialization</span>
|
||||
<span class='id identifier rubyid_assert_respond_to'>assert_respond_to</span> <span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='symbol'>:read_attribute_for_serialization</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>The resource should respond to read_attribute_for_serialization</span><span class='tstring_end'>'</span></span>
|
||||
<span class='id identifier rubyid_actual_arity'>actual_arity</span> <span class='op'>=</span> <span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:read_attribute_for_serialization</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_arity'>arity</span>
|
||||
<span class='comment'># using absolute value since arity is:
|
||||
</span> <span class='comment'># 1 for def read_attribute_for_serialization(name); end
|
||||
</span> <span class='comment'># -1 for alias :read_attribute_for_serialization :send
|
||||
</span> <span class='id identifier rubyid_assert_equal'>assert_equal</span> <span class='int'>1</span><span class='comma'>,</span> <span class='id identifier rubyid_actual_arity'>actual_arity</span><span class='period'>.</span><span class='id identifier rubyid_abs'>abs</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>expected </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_actual_arity'>actual_arity</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>.abs to be 1 or -1</span><span class='tstring_end'>"</span></span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="test_serializable_hash-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>test_serializable_hash</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Passes if the object responds to <code>serializable_hash</code> and if it
|
||||
takes zero or one arguments. Fails otherwise.</p>
|
||||
|
||||
<p><code>serializable_hash</code> returns a hash representation of a
|
||||
object's attributes. Typically, it is implemented by including
|
||||
ActiveModel::Serialization.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
24
|
||||
25
|
||||
26
|
||||
27
|
||||
28</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/lint.rb', line 24</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_test_serializable_hash'>test_serializable_hash</span>
|
||||
<span class='id identifier rubyid_assert_respond_to'>assert_respond_to</span> <span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='symbol'>:serializable_hash</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>The resource should respond to serializable_hash</span><span class='tstring_end'>'</span></span>
|
||||
<span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_serializable_hash'>serializable_hash</span>
|
||||
<span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_serializable_hash'>serializable_hash</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="test_to_json-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>test_to_json</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Passes if the object responds to <code>to_json</code> and if it takes zero
|
||||
or one arguments. Fails otherwise.</p>
|
||||
|
||||
<p><code>to_json</code> returns a string representation (JSON) of a serialized
|
||||
object. It may be called on the result of <code>as_json</code>. Typically,
|
||||
it is implemented on all objects when the JSON gem is required.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
67
|
||||
68
|
||||
69
|
||||
70
|
||||
71</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/lint.rb', line 67</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_test_to_json'>test_to_json</span>
|
||||
<span class='id identifier rubyid_assert_respond_to'>assert_respond_to</span> <span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='symbol'>:to_json</span>
|
||||
<span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span>
|
||||
<span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="test_updated_at-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>test_updated_at</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Passes if the object responds to <code>updated_at</code> and if it takes no
|
||||
arguments. Fails otherwise.</p>
|
||||
|
||||
<p><code>updated_at</code> returns a Time object or iso8601 string and is part
|
||||
of the (self-expiring) cache_key, which is used by the adapter. It is not
|
||||
required unless caching is enabled.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
92
|
||||
93
|
||||
94
|
||||
95
|
||||
96</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/lint.rb', line 92</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_test_updated_at'>test_updated_at</span>
|
||||
<span class='id identifier rubyid_assert_respond_to'>assert_respond_to</span> <span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='symbol'>:updated_at</span>
|
||||
<span class='id identifier rubyid_actual_arity'>actual_arity</span> <span class='op'>=</span> <span class='id identifier rubyid_resource'>resource</span><span class='period'>.</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:updated_at</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_arity'>arity</span>
|
||||
<span class='id identifier rubyid_assert_equal'>assert_equal</span> <span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_actual_arity'>actual_arity</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:35 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,124 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Meta
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Meta.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (M)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Meta</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Meta
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Concern</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Included in:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></dd>
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/meta.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Meta/ClassMethods.html" title="ActiveModel::Serializer::Meta::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:35 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,201 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Meta::ClassMethods
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModel/Serializer/Meta/ClassMethods.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span> » <span class='title'><span class='object_link'><a href="../Meta.html" title="ActiveModel::Serializer::Meta (module)">Meta</a></span></span>
|
||||
»
|
||||
<span class="title">ClassMethods</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Meta::ClassMethods
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/meta.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#meta-instance_method" title="#meta (instance method)">- (Object) <strong>meta</strong>(value = nil, &block) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Set the JSON API meta attribute of a serializer.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="meta-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>meta</strong>(value = nil, &block)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Set the JSON API meta attribute of a serializer.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code>class AdminAuthorSerializer < ActiveModel::Serializer
|
||||
meta { stuff: 'value' }</code></pre>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='id identifier rubyid_meta'>meta</span> <span class='kw'>do</span>
|
||||
<span class='lbrace'>{</span> <span class='label'>comment_count:</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_comments'>comments</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
23
|
||||
24
|
||||
25</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/meta.rb', line 23</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_meta'>meta</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
||||
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__meta'>_meta</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span> <span class='op'>||</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:35 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,399 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::Null
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Null.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (N)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Null</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::Null
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::Null</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/null.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<h3 class="inherited">Constants inherited
|
||||
from <span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../Serializer.html#SERIALIZABLE_HASH_VALID_KEYS-constant" title="ActiveModel::Serializer::SERIALIZABLE_HASH_VALID_KEYS (constant)">SERIALIZABLE_HASH_VALID_KEYS</a></span>, <span class='object_link'><a href="../Serializer.html#UndefinedCacheKey-constant" title="ActiveModel::Serializer::UndefinedCacheKey (constant)">UndefinedCacheKey</a></span>, <span class='object_link'><a href="../Serializer.html#VERSION-constant" title="ActiveModel::Serializer::VERSION (constant)">VERSION</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Constants included
|
||||
from <span class='object_link'><a href="Caching.html" title="ActiveModel::Serializer::Caching (module)">Caching</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Caching.html#CALLER_FILE-constant" title="ActiveModel::Serializer::Caching::CALLER_FILE (constant)">Caching::CALLER_FILE</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../Serializer.html#object-instance_method" title="ActiveModel::Serializer#object (method)">#object</a></span>, <span class='object_link'><a href="../Serializer.html#root-instance_method" title="ActiveModel::Serializer#root (method)">#root</a></span>, <span class='object_link'><a href="../Serializer.html#scope-instance_method" title="ActiveModel::Serializer#scope (method)">#scope</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#associations-instance_method" title="#associations (instance method)">- (Object) <strong>associations</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#attributes-instance_method" title="#attributes (instance method)">- (Object) <strong>attributes</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serializable_hash-instance_method" title="#serializable_hash (instance method)">- (Object) <strong>serializable_hash</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../Serializer.html#adapter-class_method" title="ActiveModel::Serializer.adapter (method)">adapter</a></span>, <span class='object_link'><a href="../Serializer.html#as_json-instance_method" title="ActiveModel::Serializer#as_json (method)">#as_json</a></span>, <span class='object_link'><a href="../Serializer.html#get_serializer_for-class_method" title="ActiveModel::Serializer.get_serializer_for (method)">get_serializer_for</a></span>, <span class='object_link'><a href="../Serializer.html#include_directive_from_options-class_method" title="ActiveModel::Serializer.include_directive_from_options (method)">include_directive_from_options</a></span>, <span class='object_link'><a href="../Serializer.html#initialize-instance_method" title="ActiveModel::Serializer#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="../Serializer.html#json_key-instance_method" title="ActiveModel::Serializer#json_key (method)">#json_key</a></span>, <span class='object_link'><a href="../Serializer.html#read_attribute_for_serialization-instance_method" title="ActiveModel::Serializer#read_attribute_for_serialization (method)">#read_attribute_for_serialization</a></span>, <span class='object_link'><a href="../Serializer.html#relationship_value_for-instance_method" title="ActiveModel::Serializer#relationship_value_for (method)">#relationship_value_for</a></span>, <span class='object_link'><a href="../Serializer.html#resource_relationships-instance_method" title="ActiveModel::Serializer#resource_relationships (method)">#resource_relationships</a></span>, <span class='object_link'><a href="../Serializer.html#serialization_adapter_instance-class_method" title="ActiveModel::Serializer.serialization_adapter_instance (method)">serialization_adapter_instance</a></span>, <span class='object_link'><a href="../Serializer.html#serializer_for-class_method" title="ActiveModel::Serializer.serializer_for (method)">serializer_for</a></span>, <span class='object_link'><a href="../Serializer.html#serializer_lookup_chain_for-class_method" title="ActiveModel::Serializer.serializer_lookup_chain_for (method)">serializer_lookup_chain_for</a></span>, <span class='object_link'><a href="../Serializer.html#serializers_cache-class_method" title="ActiveModel::Serializer.serializers_cache (method)">serializers_cache</a></span>, <span class='object_link'><a href="../Serializer.html#success%3F-instance_method" title="ActiveModel::Serializer#success? (method)">#success?</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">ActiveModelSerializers::Deprecate</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html#delegate_and_deprecate-class_method" title="ActiveModelSerializers::Deprecate.delegate_and_deprecate (method)">delegate_and_deprecate</a></span>, <span class='object_link'><a href="../../ActiveModelSerializers/Deprecate.html#deprecate-class_method" title="ActiveModelSerializers::Deprecate.deprecate (method)">deprecate</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="Caching.html" title="ActiveModel::Serializer::Caching (module)">Caching</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Caching.html#cache_key-instance_method" title="ActiveModel::Serializer::Caching#cache_key (method)">#cache_key</a></span>, <span class='object_link'><a href="Caching.html#fetch-instance_method" title="ActiveModel::Serializer::Caching#fetch (method)">#fetch</a></span>, <span class='object_link'><a href="Caching.html#fetch_attributes-instance_method" title="ActiveModel::Serializer::Caching#fetch_attributes (method)">#fetch_attributes</a></span>, <span class='object_link'><a href="Caching.html#fetch_attributes_fragment-instance_method" title="ActiveModel::Serializer::Caching#fetch_attributes_fragment (method)">#fetch_attributes_fragment</a></span>, <span class='object_link'><a href="Caching.html#object_cache_key-instance_method" title="ActiveModel::Serializer::Caching#object_cache_key (method)">#object_cache_key</a></span>, <span class='object_link'><a href="Caching.html#serializer_class-instance_method" title="ActiveModel::Serializer::Caching#serializer_class (method)">#serializer_class</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="../Serializer.html#initialize-instance_method" title="ActiveModel::Serializer#initialize (method)">ActiveModel::Serializer</a></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="associations-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>associations</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
8
|
||||
9
|
||||
10</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/null.rb', line 8</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_associations'>associations</span><span class='lparen'>(</span><span class='op'>*</span><span class='rparen'>)</span>
|
||||
<span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="attributes-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>attributes</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
4
|
||||
5
|
||||
6</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/null.rb', line 4</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='lparen'>(</span><span class='op'>*</span><span class='rparen'>)</span>
|
||||
<span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serializable_hash-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serializable_hash</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
12
|
||||
13
|
||||
14</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/null.rb', line 12</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serializable_hash'>serializable_hash</span><span class='lparen'>(</span><span class='op'>*</span><span class='rparen'>)</span>
|
||||
<span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:38 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,738 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::Reflection
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Reflection.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (R)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Reflection</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::Reflection
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">Struct</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::Reflection</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/reflection.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Holds all the meta-data about an association as it was specified in the
|
||||
ActiveModel::Serializer class.</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">Specifically, the association 'comments' is evaluated two different ways:
|
||||
1) as 'comments' and named 'comments'.
|
||||
2) as 'object.comments.last(1)' and named 'last_comments'.
|
||||
|
||||
PostSerializer._reflections #=>
|
||||
# [
|
||||
# HasOneReflection.new(:author, serializer: AuthorSerializer),
|
||||
# HasManyReflection.new(:comments)
|
||||
# HasManyReflection.new(:comments, { key: :last_comments }, #<Block>)
|
||||
# HasManyReflection.new(:secret_meta_data, { if: :is_admin? })
|
||||
# ]</code></pre>
|
||||
|
||||
<p>So you can inspect reflections in your Adapters.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='kw'>class</span> <span class='const'>PostSerializer</span> <span class='op'><</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span>
|
||||
<span class='id identifier rubyid_has_one'>has_one</span> <span class='symbol'>:author</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='const'>AuthorSerializer</span>
|
||||
<span class='id identifier rubyid_has_many'>has_many</span> <span class='symbol'>:comments</span>
|
||||
<span class='id identifier rubyid_has_many'>has_many</span> <span class='symbol'>:comments</span><span class='comma'>,</span> <span class='label'>key:</span> <span class='symbol'>:last_comments</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_comments'>comments</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='id identifier rubyid_has_many'>has_many</span> <span class='symbol'>:secret_meta_data</span><span class='comma'>,</span> <span class='label'>if:</span> <span class='symbol'>:is_admin?</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_is_admin?'>is_admin?</span>
|
||||
<span class='id identifier rubyid_current_user'>current_user</span><span class='period'>.</span><span class='id identifier rubyid_admin?'>admin?</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><div id="subclasses">
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class="children"><span class='object_link'><a href="CollectionReflection.html" title="ActiveModel::Serializer::CollectionReflection (class)">CollectionReflection</a></span>, <span class='object_link'><a href="SingularReflection.html" title="ActiveModel::Serializer::SingularReflection (class)">SingularReflection</a></span></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Field.html#block-instance_method" title="ActiveModel::Serializer::Field#block (method)">#block</a></span>, <span class='object_link'><a href="Field.html#name-instance_method" title="ActiveModel::Serializer::Field#name (method)">#name</a></span>, <span class='object_link'><a href="Field.html#options-instance_method" title="ActiveModel::Serializer::Field#options (method)">#options</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#build_association-instance_method" title="#build_association (instance method)">- (Object) <strong>build_association</strong>(subject, parent_serializer_options) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="private note title">private</span>
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Build association.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#include_data-instance_method" title="#include_data (instance method)">- (Object) <strong>include_data</strong>(value = true) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Reflection) <strong>initialize</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of Reflection.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#link-instance_method" title="#link (instance method)">- (Object) <strong>link</strong>(name, value = nil, &block) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#meta-instance_method" title="#meta (instance method)">- (Object) <strong>meta</strong>(value = nil, &block) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#value-instance_method" title="#value (instance method)">- (:nil, associated resource or resource collection) <strong>value</strong>(serializer) {|ActiveModel::Serializer| ... }</a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></tt>) <strong>initialize</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of Reflection</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
37
|
||||
38
|
||||
39
|
||||
40
|
||||
41
|
||||
42</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/reflection.rb', line 37</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span>
|
||||
<span class='ivar'>@_links</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='ivar'>@_include_data</span> <span class='op'>=</span> <span class='kw'>true</span>
|
||||
<span class='ivar'>@_meta</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="build_association-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>build_association</strong>(subject, parent_serializer_options)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
<p class="note private">
|
||||
<strong>This method is part of a private API.</strong>
|
||||
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
||||
</p>
|
||||
|
||||
<p>Build association. This method is used internally to build serializer's
|
||||
association by its reflection.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='comment'># Given the following serializer defined:
|
||||
</span><span class='kw'>class</span> <span class='const'>PostSerializer</span> <span class='op'><</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span>
|
||||
<span class='id identifier rubyid_has_many'>has_many</span> <span class='symbol'>:comments</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='const'>CommentSummarySerializer</span>
|
||||
<span class='kw'>end</span>
|
||||
|
||||
<span class='comment'># Then you instantiate your serializer
|
||||
</span><span class='id identifier rubyid_post_serializer'>post_serializer</span> <span class='op'>=</span> <span class='const'>PostSerializer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_post'>post</span><span class='comma'>,</span> <span class='label'>foo:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>bar</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#
|
||||
</span><span class='comment'># to build association for comments you need to get reflection
|
||||
</span><span class='id identifier rubyid_comments_reflection'>comments_reflection</span> <span class='op'>=</span> <span class='const'>PostSerializer</span><span class='period'>.</span><span class='id identifier rubyid__reflections'>_reflections</span><span class='period'>.</span><span class='id identifier rubyid_detect'>detect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>==</span> <span class='symbol'>:comments</span> <span class='rbrace'>}</span>
|
||||
<span class='comment'># and #build_association
|
||||
</span><span class='id identifier rubyid_comments_reflection'>comments_reflection</span><span class='period'>.</span><span class='id identifier rubyid_build_association'>build_association</span><span class='lparen'>(</span><span class='id identifier rubyid_post_serializer'>post_serializer</span><span class='comma'>,</span> <span class='label'>foo:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>bar</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span></code></pre>
|
||||
|
||||
</div>
|
||||
<p class="tag_title">Parameters:</p>
|
||||
<ul class="param">
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>subject</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>is a parent serializer for given association</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>parent_serializer_options</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Hash{Symbol => Object}</tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
109
|
||||
110
|
||||
111
|
||||
112
|
||||
113
|
||||
114
|
||||
115
|
||||
116
|
||||
117
|
||||
118
|
||||
119
|
||||
120
|
||||
121
|
||||
122
|
||||
123
|
||||
124
|
||||
125
|
||||
126
|
||||
127
|
||||
128
|
||||
129</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/reflection.rb', line 109</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_build_association'>build_association</span><span class='lparen'>(</span><span class='id identifier rubyid_subject'>subject</span><span class='comma'>,</span> <span class='id identifier rubyid_parent_serializer_options'>parent_serializer_options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_association_value'>association_value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='lparen'>(</span><span class='id identifier rubyid_subject'>subject</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_reflection_options'>reflection_options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
|
||||
<span class='id identifier rubyid_serializer_class'>serializer_class</span> <span class='op'>=</span> <span class='id identifier rubyid_subject'>subject</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_serializer_for'>serializer_for</span><span class='lparen'>(</span><span class='id identifier rubyid_association_value'>association_value</span><span class='comma'>,</span> <span class='id identifier rubyid_reflection_options'>reflection_options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_reflection_options'>reflection_options</span><span class='lbracket'>[</span><span class='symbol'>:include_data</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='ivar'>@_include_data</span>
|
||||
|
||||
<span class='kw'>if</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span>
|
||||
<span class='kw'>begin</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer_class'>serializer_class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
|
||||
<span class='id identifier rubyid_association_value'>association_value</span><span class='comma'>,</span>
|
||||
<span class='id identifier rubyid_serializer_options'>serializer_options</span><span class='lparen'>(</span><span class='id identifier rubyid_subject'>subject</span><span class='comma'>,</span> <span class='id identifier rubyid_parent_serializer_options'>parent_serializer_options</span><span class='comma'>,</span> <span class='id identifier rubyid_reflection_options'>reflection_options</span><span class='rparen'>)</span>
|
||||
<span class='rparen'>)</span>
|
||||
<span class='kw'>rescue</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span><span class='op'>::</span><span class='const'>CollectionSerializer</span><span class='op'>::</span><span class='const'>NoSerializerError</span>
|
||||
<span class='id identifier rubyid_reflection_options'>reflection_options</span><span class='lbracket'>[</span><span class='symbol'>:virtual_value</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_association_value'>association_value</span><span class='period'>.</span><span class='id identifier rubyid_try'>try</span><span class='lparen'>(</span><span class='symbol'>:as_json</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_association_value'>association_value</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>elsif</span> <span class='op'>!</span><span class='id identifier rubyid_association_value'>association_value</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_association_value'>association_value</span><span class='period'>.</span><span class='id identifier rubyid_instance_of?'>instance_of?</span><span class='lparen'>(</span><span class='const'>Object</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_reflection_options'>reflection_options</span><span class='lbracket'>[</span><span class='symbol'>:virtual_value</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_association_value'>association_value</span>
|
||||
<span class='kw'>end</span>
|
||||
|
||||
<span class='const'>Association</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_reflection_options'>reflection_options</span><span class='comma'>,</span> <span class='ivar'>@_links</span><span class='comma'>,</span> <span class='ivar'>@_meta</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="include_data-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>include_data</strong>(value = true)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
54
|
||||
55
|
||||
56
|
||||
57</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/reflection.rb', line 54</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_include_data'>include_data</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@_include_data</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='symbol'>:nil</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="link-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>link</strong>(name, value = nil, &block)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
44
|
||||
45
|
||||
46
|
||||
47</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/reflection.rb', line 44</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_link'>link</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@_links</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span> <span class='op'>||</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='symbol'>:nil</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="meta-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>meta</strong>(value = nil, &block)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
49
|
||||
50
|
||||
51
|
||||
52</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/reflection.rb', line 49</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_meta'>meta</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@_meta</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span> <span class='op'>||</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='symbol'>:nil</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="value-instance_method">
|
||||
|
||||
- (<tt>:nil</tt>, <tt>associated resource or resource collection</tt>) <strong>value</strong>(serializer) {|ActiveModel::Serializer| ... }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='id identifier rubyid_has_one'>has_one</span> <span class='symbol'>:blog</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_serializer'>serializer</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_cached_blog'>cached_blog</span>
|
||||
<span class='kw'>end</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_cached_blog'>cached_blog</span>
|
||||
<span class='id identifier rubyid_cache_store'>cache_store</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>cached_blog:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_updated_at'>updated_at</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
|
||||
<span class='const'>Blog</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_blog_id'>blog_id</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></code></pre>
|
||||
|
||||
</div>
|
||||
<p class="tag_title">Parameters:</p>
|
||||
<ul class="param">
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>serializer</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p class="tag_title">Yields:</p>
|
||||
<ul class="yield">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>:nil</tt>, <tt>associated resource or resource collection</tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
72
|
||||
73
|
||||
74
|
||||
75
|
||||
76
|
||||
77
|
||||
78
|
||||
79
|
||||
80
|
||||
81
|
||||
82
|
||||
83
|
||||
84
|
||||
85
|
||||
86</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/reflection.rb', line 72</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_value'>value</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@object</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_object'>object</span>
|
||||
<span class='ivar'>@scope</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_scope'>scope</span>
|
||||
|
||||
<span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span>
|
||||
<span class='id identifier rubyid_block_value'>block_value</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_exec'>instance_exec</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
||||
<span class='kw'>if</span> <span class='id identifier rubyid_block_value'>block_value</span> <span class='op'>!=</span> <span class='symbol'>:nil</span>
|
||||
<span class='id identifier rubyid_block_value'>block_value</span>
|
||||
<span class='kw'>elsif</span> <span class='ivar'>@_include_data</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_read_attribute_for_serialization'>read_attribute_for_serialization</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_read_attribute_for_serialization'>read_attribute_for_serialization</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:38 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,172 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModel::Serializer::SingularReflection
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/SingularReflection.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (S)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">SingularReflection</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModel::Serializer::SingularReflection
|
||||
|
||||
|
||||
<span class="private note title">Private</span>
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">Struct</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></li>
|
||||
|
||||
<li class="next">ActiveModel::Serializer::SingularReflection</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model/serializer/singular_reflection.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="docstring">
|
||||
<div class="discussion">
|
||||
<p class="note private">
|
||||
<strong>This class is part of a private API.</strong>
|
||||
You should avoid using this class if possible, as it may be removed or be changed in the future.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><div id="subclasses">
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class="children"><span class='object_link'><a href="BelongsToReflection.html" title="ActiveModel::Serializer::BelongsToReflection (class)">BelongsToReflection</a></span>, <span class='object_link'><a href="HasOneReflection.html" title="ActiveModel::Serializer::HasOneReflection (class)">HasOneReflection</a></span></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Field.html#block-instance_method" title="ActiveModel::Serializer::Field#block (method)">#block</a></span>, <span class='object_link'><a href="Field.html#name-instance_method" title="ActiveModel::Serializer::Field#name (method)">#name</a></span>, <span class='object_link'><a href="Field.html#options-instance_method" title="ActiveModel::Serializer::Field#options (method)">#options</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Method Summary</h2>
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Reflection.html#build_association-instance_method" title="ActiveModel::Serializer::Reflection#build_association (method)">#build_association</a></span>, <span class='object_link'><a href="Reflection.html#include_data-instance_method" title="ActiveModel::Serializer::Reflection#include_data (method)">#include_data</a></span>, <span class='object_link'><a href="Reflection.html#initialize-instance_method" title="ActiveModel::Serializer::Reflection#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Reflection.html#link-instance_method" title="ActiveModel::Serializer::Reflection#link (method)">#link</a></span>, <span class='object_link'><a href="Reflection.html#meta-instance_method" title="ActiveModel::Serializer::Reflection#meta (method)">#meta</a></span>, <span class='object_link'><a href="Reflection.html#value-instance_method" title="ActiveModel::Serializer::Reflection#value (method)">#value</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Reflection.html#initialize-instance_method" title="ActiveModel::Serializer::Reflection#initialize (method)">ActiveModel::Serializer::Reflection</a></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,124 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Type
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModel/Serializer/Type.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (T)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">Type</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Type
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Concern</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Included in:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span></dd>
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/type.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Type/ClassMethods.html" title="ActiveModel::Serializer::Type::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:35 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,196 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModel::Serializer::Type::ClassMethods
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModel/Serializer/Type/ClassMethods.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span></span> » <span class='title'><span class='object_link'><a href="../../Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span></span> » <span class='title'><span class='object_link'><a href="../Type.html" title="ActiveModel::Serializer::Type (module)">Type</a></span></span>
|
||||
»
|
||||
<span class="title">ClassMethods</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModel::Serializer::Type::ClassMethods
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model/serializer/type.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#type-instance_method" title="#type (instance method)">- (Object) <strong>type</strong>(type) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Set the JSON API type of a serializer.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="type-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>type</strong>(type)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Set the JSON API type of a serializer.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code>class AdminAuthorSerializer < ActiveModel::Serializer
|
||||
type 'authors'</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
19
|
||||
20
|
||||
21</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model/serializer/type.rb', line 19</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
||||
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__type'>_type</span> <span class='op'>=</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>&&</span> <span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:35 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,462 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '';
|
||||
framesUrl = "frames.html#!ActiveModelSerializers.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="_index.html">Index (A)</a> »
|
||||
|
||||
|
||||
<span class="title">ActiveModelSerializers</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Autoload</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/model.rb<span class="defines">,<br />
|
||||
lib/active_model_serializers.rb,<br /> lib/active_model_serializers/test.rb,<br /> lib/active_model_serializers/railtie.rb,<br /> lib/active_model_serializers/adapter.rb,<br /> lib/active_model_serializers/logging.rb,<br /> lib/active_model_serializers/deprecate.rb,<br /> lib/active_model_serializers/callbacks.rb,<br /> lib/active_model_serializers/test/schema.rb,<br /> lib/active_model_serializers/adapter/null.rb,<br /> lib/active_model_serializers/adapter/base.rb,<br /> lib/active_model_serializers/json_pointer.rb,<br /> lib/active_model_serializers/adapter/json.rb,<br /> lib/active_model_serializers/key_transform.rb,<br /> lib/active_model_serializers/test/serializer.rb,<br /> lib/active_model_serializers/deserialization.rb,<br /> lib/active_model_serializers/adapter/json_api.rb,<br /> lib/active_model_serializers/adapter/attributes.rb,<br /> lib/active_model_serializers/adapter/json_api/link.rb,<br /> lib/active_model_serializers/serialization_context.rb,<br /> lib/active_model_serializers/serializable_resource.rb,<br /> lib/active_model_serializers/adapter/json_api/meta.rb,<br /> lib/active_model_serializers/adapter/json_api/error.rb,<br /> lib/active_model_serializers/adapter/json_api/jsonapi.rb,<br /> lib/active_model_serializers/adapter/json_api/relationship.rb,<br /> lib/active_model_serializers/adapter/json_api/deserialization.rb,<br /> lib/active_model_serializers/adapter/json_api/pagination_links.rb,<br /> lib/active_model_serializers/adapter/json_api/resource_identifier.rb</span>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p><a href="http://jsonapi.org/format/" target="_parent" title="JSON API specification">JSON API specification</a> rubocop:disable
|
||||
Style/AsciiComments TODO: implement!</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_☐'>☐</span> <span class='label'>https:</span><span class='tstring'><span class='regexp_beg'>/</span><span class='regexp_end'>/github</span></span><span class='period'>.</span><span class='id identifier rubyid_com'>com</span><span class='op'>/</span><span class='id identifier rubyid_rails'>rails</span><span class='op'>-</span><span class='id identifier rubyid_api'>api</span><span class='op'>/</span><span class='id identifier rubyid_active_model_serializers'>active_model_serializers</span><span class='op'>/</span><span class='id identifier rubyid_issues'>issues</span><span class='op'>/</span><span class='int'>1235</span></code></pre>
|
||||
|
||||
<p>TODO: use uri_template in link generation?</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">☐ https://github.com/rails-api/active_model_serializers/pull/1282#discussion_r42528812
|
||||
see gem https://github.com/hannesg/uri_template
|
||||
spec http://tools.ietf.org/html/rfc6570
|
||||
impl https://developer.github.com/v3/#schema https://api.github.com/</code></pre>
|
||||
|
||||
<p>TODO: validate against a JSON schema document?</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_☐'>☐</span> <span class='label'>https:</span><span class='tstring'><span class='regexp_beg'>/</span><span class='regexp_end'>/github</span></span><span class='period'>.</span><span class='id identifier rubyid_com'>com</span><span class='op'>/</span><span class='id identifier rubyid_rails'>rails</span><span class='op'>-</span><span class='id identifier rubyid_api'>api</span><span class='op'>/</span><span class='id identifier rubyid_active_model_serializers'>active_model_serializers</span><span class='op'>/</span><span class='id identifier rubyid_issues'>issues</span><span class='op'>/</span><span class='int'>1162</span>
|
||||
<span class='id identifier rubyid_☑'>☑</span> <span class='label'>https:</span><span class='tstring'><span class='regexp_beg'>/</span><span class='regexp_end'>/github</span></span><span class='period'>.</span><span class='id identifier rubyid_com'>com</span><span class='op'>/</span><span class='id identifier rubyid_rails'>rails</span><span class='op'>-</span><span class='id identifier rubyid_api'>api</span><span class='op'>/</span><span class='id identifier rubyid_active_model_serializers'>active_model_serializers</span><span class='op'>/</span><span class='id identifier rubyid_pull'>pull</span><span class='op'>/</span><span class='int'>1270</span></code></pre>
|
||||
|
||||
<p>TODO: Routing</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_☐'>☐</span> <span class='label'>https:</span><span class='tstring'><span class='regexp_beg'>/</span><span class='regexp_end'>/github</span></span><span class='period'>.</span><span class='id identifier rubyid_com'>com</span><span class='op'>/</span><span class='id identifier rubyid_rails'>rails</span><span class='op'>-</span><span class='id identifier rubyid_api'>api</span><span class='op'>/</span><span class='id identifier rubyid_active_model_serializers'>active_model_serializers</span><span class='op'>/</span><span class='id identifier rubyid_pull'>pull</span><span class='op'>/</span><span class='int'>1476</span></code></pre>
|
||||
|
||||
<p>TODO: Query Params</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">☑ `include` https://github.com/rails-api/active_model_serializers/pull/1131
|
||||
☑ `fields` https://github.com/rails-api/active_model_serializers/pull/700
|
||||
☑ `page[number]=3&page[size]=1` https://github.com/rails-api/active_model_serializers/pull/1041
|
||||
☐ `filter`
|
||||
☐ `sort`</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="ActiveModelSerializers/Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span>, <span class='object_link'><a href="ActiveModelSerializers/Callbacks.html" title="ActiveModelSerializers::Callbacks (module)">Callbacks</a></span>, <span class='object_link'><a href="ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">Deprecate</a></span>, <span class='object_link'><a href="ActiveModelSerializers/Deserialization.html" title="ActiveModelSerializers::Deserialization (module)">Deserialization</a></span>, <span class='object_link'><a href="ActiveModelSerializers/JsonPointer.html" title="ActiveModelSerializers::JsonPointer (module)">JsonPointer</a></span>, <span class='object_link'><a href="ActiveModelSerializers/Jsonapi.html" title="ActiveModelSerializers::Jsonapi (module)">Jsonapi</a></span>, <span class='object_link'><a href="ActiveModelSerializers/KeyTransform.html" title="ActiveModelSerializers::KeyTransform (module)">KeyTransform</a></span>, <span class='object_link'><a href="ActiveModelSerializers/Logging.html" title="ActiveModelSerializers::Logging (module)">Logging</a></span>, <span class='object_link'><a href="ActiveModelSerializers/Test.html" title="ActiveModelSerializers::Test (module)">Test</a></span>
|
||||
|
||||
|
||||
|
||||
<strong class="classes">Classes:</strong> <span class='object_link'><a href="ActiveModelSerializers/Model.html" title="ActiveModelSerializers::Model (class)">Model</a></span>, <span class='object_link'><a href="ActiveModelSerializers/Railtie.html" title="ActiveModelSerializers::Railtie (class)">Railtie</a></span>, <span class='object_link'><a href="ActiveModelSerializers/SerializableResource.html" title="ActiveModelSerializers::SerializableResource (class)">SerializableResource</a></span>, <span class='object_link'><a href="ActiveModelSerializers/SerializationContext.html" title="ActiveModelSerializers::SerializationContext (class)">SerializationContext</a></span>
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Class Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#logger-class_method" title="logger (class method)">+ (Object) <strong>logger</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute logger.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#config-class_method" title="config (class method)">+ (Object) <strong>config</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#default_include_directive-class_method" title="default_include_directive (class method)">+ (JSONAPI::IncludeDirective) <strong>default_include_directive</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Memoized default include directive.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#location_of_caller-class_method" title="location_of_caller (class method)">+ (Object) <strong>location_of_caller</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>The file name and line number of the caller of the caller of this method.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_attr_details" class="attr_details">
|
||||
<h2>Class Attribute Details</h2>
|
||||
|
||||
|
||||
<span id="logger=-class_method"></span>
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="logger-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>logger</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute logger</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
18
|
||||
19
|
||||
20</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers.rb', line 18</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_logger'>logger</span>
|
||||
<span class='ivar'>@logger</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="config-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>config</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
21
|
||||
22
|
||||
23</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers.rb', line 21</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span>
|
||||
<span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="default_include_directive-class_method">
|
||||
|
||||
+ (<tt>JSONAPI::IncludeDirective</tt>) <strong>default_include_directive</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Memoized default include directive</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>JSONAPI::IncludeDirective</tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
36
|
||||
37
|
||||
38</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers.rb', line 36</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default_include_directive'>default_include_directive</span>
|
||||
<span class='ivar'>@default_include_directive</span> <span class='op'>||=</span> <span class='const'>JSONAPI</span><span class='op'>::</span><span class='const'>IncludeDirective</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_default_includes'>default_includes</span><span class='comma'>,</span> <span class='label'>allow_wildcard:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="location_of_caller-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>location_of_caller</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>The file name and line number of the caller of the caller of this method.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
26
|
||||
27
|
||||
28
|
||||
29
|
||||
30
|
||||
31
|
||||
32</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers.rb', line 26</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_location_of_caller'>location_of_caller</span>
|
||||
<span class='id identifier rubyid_caller'>caller</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(.*?):(\d+).*?$</span><span class='regexp_end'>/i</span></span>
|
||||
<span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_last_match'>last_match</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_lineno'>lineno</span> <span class='op'>=</span> <span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_last_match'>last_match</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
||||
|
||||
<span class='lbracket'>[</span><span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='id identifier rubyid_lineno'>lineno</span><span class='rbracket'>]</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:35 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,887 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Adapter
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/Adapter.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">Adapter</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Adapter
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Autoload</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/adapter.rb<span class="defines">,<br />
|
||||
lib/active_model_serializers/adapter/null.rb,<br /> lib/active_model_serializers/adapter/base.rb,<br /> lib/active_model_serializers/adapter/json.rb,<br /> lib/active_model_serializers/adapter/json_api.rb,<br /> lib/active_model_serializers/adapter/attributes.rb,<br /> lib/active_model_serializers/adapter/json_api/link.rb,<br /> lib/active_model_serializers/adapter/json_api/meta.rb,<br /> lib/active_model_serializers/adapter/json_api/error.rb,<br /> lib/active_model_serializers/adapter/json_api/jsonapi.rb,<br /> lib/active_model_serializers/adapter/json_api/relationship.rb,<br /> lib/active_model_serializers/adapter/json_api/deserialization.rb,<br /> lib/active_model_serializers/adapter/json_api/pagination_links.rb,<br /> lib/active_model_serializers/adapter/json_api/resource_identifier.rb</span>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
|
||||
|
||||
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Adapter/Attributes.html" title="ActiveModelSerializers::Adapter::Attributes (class)">Attributes</a></span>, <span class='object_link'><a href="Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span>, <span class='object_link'><a href="Adapter/Json.html" title="ActiveModelSerializers::Adapter::Json (class)">Json</a></span>, <span class='object_link'><a href="Adapter/JsonApi.html" title="ActiveModelSerializers::Adapter::JsonApi (class)">JsonApi</a></span>, <span class='object_link'><a href="Adapter/Null.html" title="ActiveModelSerializers::Adapter::Null (class)">Null</a></span>
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<dl class="constants">
|
||||
|
||||
<dt id="UnknownAdapterError-constant" class="">UnknownAdapterError =
|
||||
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>ArgumentError</span><span class='rparen'>)</span></pre></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#adapter_class-class_method" title="adapter_class (class method)">+ (Object) <strong>adapter_class</strong>(adapter) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#adapter_map-class_method" title="adapter_map (class method)">+ (Hash<adapter_name, adapter_class>) <strong>adapter_map</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#adapters-class_method" title="adapters (class method)">+ (Array<Symbol>) <strong>adapters</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>List of adapter names.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#configured_adapter-class_method" title="configured_adapter (class method)">+ (Object) <strong>configured_adapter</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>:nocov:.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#create-class_method" title="create (class method)">+ (Object) <strong>create</strong>(resource, options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#lookup-class_method" title="lookup (class method)">+ (ActiveModelSerializers::Adapter) <strong>lookup</strong>(adapter) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Subclass of Adapter.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#new-class_method" title="new (class method)">+ (Object) <strong>new</strong>(*args) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>:nocov:.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#register-class_method" title="register (class method)">+ (Object) <strong>register</strong>(name, klass = name) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Adds an adapter 'klass' with 'name' to the
|
||||
'adapter_map' Names are stringified and underscored.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#registered_name-class_method" title="registered_name (class method)">+ (Object) <strong>registered_name</strong>(adapter_class) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="adapter_class-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>adapter_class</strong>(adapter)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
<p class="tag_title">See Also:</p>
|
||||
<ul class="see">
|
||||
|
||||
<li><span class='object_link'><a href="#lookup-class_method" title="ActiveModelSerializers::Adapter.lookup (method)">lookup</a></span></li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
27
|
||||
28
|
||||
29</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter.rb', line 27</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_adapter_class'>adapter_class</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter'>adapter</span><span class='rparen'>)</span>
|
||||
<span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_lookup'>lookup</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter'>adapter</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="adapter_map-class_method">
|
||||
|
||||
+ (<tt>Hash<adapter_name, <span class='object_link'><a href="#adapter_class-class_method" title="ActiveModelSerializers::Adapter.adapter_class (method)">adapter_class</a></span>></tt>) <strong>adapter_map</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Hash<adapter_name, <span class='object_link'><a href="#adapter_class-class_method" title="ActiveModelSerializers::Adapter.adapter_class (method)">adapter_class</a></span>></tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
32
|
||||
33
|
||||
34</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter.rb', line 32</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_adapter_map'>adapter_map</span>
|
||||
<span class='const'>ADAPTER_MAP</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="adapters-class_method">
|
||||
|
||||
+ (<tt>Array<Symbol></tt>) <strong>adapters</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns list of adapter names</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Array<Symbol></tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>list of adapter names</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
37
|
||||
38
|
||||
39</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter.rb', line 37</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_adapters'>adapters</span>
|
||||
<span class='id identifier rubyid_adapter_map'>adapter_map</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="configured_adapter-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>configured_adapter</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>:nocov:</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
16
|
||||
17
|
||||
18</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter.rb', line 16</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_configured_adapter'>configured_adapter</span>
|
||||
<span class='id identifier rubyid_lookup'>lookup</span><span class='lparen'>(</span><span class='const'>ActiveModelSerializers</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_adapter'>adapter</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="create-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>create</strong>(resource, options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
20
|
||||
21
|
||||
22
|
||||
23
|
||||
24</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter.rb', line 20</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_override'>override</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:adapter</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='id identifier rubyid_override'>override</span> <span class='op'>?</span> <span class='id identifier rubyid_adapter_class'>adapter_class</span><span class='lparen'>(</span><span class='id identifier rubyid_override'>override</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_configured_adapter'>configured_adapter</span>
|
||||
<span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="lookup-class_method">
|
||||
|
||||
+ (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Adapter (module)">ActiveModelSerializers::Adapter</a></span></tt>) <strong>lookup</strong>(adapter)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns subclass of Adapter</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
<p class="tag_title">Parameters:</p>
|
||||
<ul class="param">
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>adapter</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>, <tt>Class</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>name to fetch adapter by</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Adapter (module)">ActiveModelSerializers::Adapter</a></span></tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>subclass of Adapter</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="tag_title">Raises:</p>
|
||||
<ul class="raise">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt><span class='object_link'><a href="#UnknownAdapterError-constant" title="ActiveModelSerializers::Adapter::UnknownAdapterError (constant)">UnknownAdapterError</a></span></tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
63
|
||||
64
|
||||
65
|
||||
66
|
||||
67
|
||||
68
|
||||
69
|
||||
70
|
||||
71
|
||||
72
|
||||
73
|
||||
74
|
||||
75
|
||||
76
|
||||
77
|
||||
78</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter.rb', line 63</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_lookup'>lookup</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter'>adapter</span><span class='rparen'>)</span>
|
||||
<span class='comment'># 1. return if is a class
|
||||
</span> <span class='kw'>return</span> <span class='id identifier rubyid_adapter'>adapter</span> <span class='kw'>if</span> <span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Class</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_adapter_name'>adapter_name</span> <span class='op'>=</span> <span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span>
|
||||
<span class='comment'># 2. return if registered
|
||||
</span> <span class='id identifier rubyid_adapter_map'>adapter_map</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_name'>adapter_name</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
||||
<span class='comment'># 3. try to find adapter class from environment
|
||||
</span> <span class='id identifier rubyid_adapter_class'>adapter_class</span> <span class='op'>=</span> <span class='id identifier rubyid_find_by_name'>find_by_name</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_name'>adapter_name</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_name'>adapter_name</span><span class='comma'>,</span> <span class='id identifier rubyid_adapter_class'>adapter_class</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_adapter_class'>adapter_class</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>rescue</span> <span class='const'>NameError</span><span class='comma'>,</span> <span class='const'>ArgumentError</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
||||
<span class='id identifier rubyid_failure_message'>failure_message</span> <span class='op'>=</span>
|
||||
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>NameError: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='embexpr_end'>}</span><span class='tstring_content'>. Unknown adapter: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>. Valid adapters are: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_adapters'>adapters</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
||||
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>UnknownAdapterError</span><span class='comma'>,</span> <span class='id identifier rubyid_failure_message'>failure_message</span><span class='comma'>,</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="new-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>new</strong>(*args)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>:nocov:</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter.rb', line 9</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_fail'>fail</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Adapters inherit from Adapter::Base.</span><span class='tstring_end'>'</span></span> \
|
||||
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Adapter.new called with args: '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>', from</span><span class='tstring_end'>"</span></span> \
|
||||
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>'caller[0]'.</span><span class='tstring_end'>"</span></span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="register-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>register</strong>(name, klass = name)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<div class="note notetag">
|
||||
<strong>Note:</strong>
|
||||
<div class='inline'>
|
||||
<p>The registered name strips out 'ActiveModelSerializers::Adapter::'
|
||||
so that registering 'ActiveModelSerializers::Adapter::Json' and
|
||||
'Json' will both register as 'json'.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<p>Adds an adapter 'klass' with 'name' to the
|
||||
'adapter_map' Names are stringified and underscored</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='const'>AMS</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='symbol'>:my_adapter</span><span class='comma'>,</span> <span class='const'>MyAdapter</span><span class='rparen'>)</span></code></pre>
|
||||
|
||||
</div>
|
||||
<p class="tag_title">Parameters:</p>
|
||||
<ul class="param">
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>name</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Symbol</tt>, <tt>String</tt>, <tt>Class</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>name of the registered adapter</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>klass</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Class</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>name</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>adapter class itself, optional if name is the class</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
50
|
||||
51
|
||||
52
|
||||
53
|
||||
54</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter.rb', line 50</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\AActiveModelSerializers::Adapter::</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_adapter_map'>adapter_map</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_klass'>klass</span>
|
||||
<span class='kw'>self</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="registered_name-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>registered_name</strong>(adapter_class)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
56
|
||||
57
|
||||
58</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter.rb', line 56</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_registered_name'>registered_name</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_class'>adapter_class</span><span class='rparen'>)</span>
|
||||
<span class='const'>ADAPTER_MAP</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span> <span class='id identifier rubyid_adapter_class'>adapter_class</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,221 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Adapter::Attributes
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModelSerializers/Adapter/Attributes.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span></span>
|
||||
»
|
||||
<span class="title">Attributes</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Adapter::Attributes
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Adapter::Attributes</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/adapter/attributes.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div id="subclasses">
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class="children"><span class='object_link'><a href="../../ActiveModel/Serializer/Adapter/Attributes.html" title="ActiveModel::Serializer::Adapter::Attributes (class)">ActiveModel::Serializer::Adapter::Attributes</a></span></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Base.html#instance_options-instance_method" title="ActiveModelSerializers::Adapter::Base#instance_options (method)">#instance_options</a></span>, <span class='object_link'><a href="Base.html#serializer-instance_method" title="ActiveModelSerializers::Adapter::Base#serializer (method)">#serializer</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serializable_hash-instance_method" title="#serializable_hash (instance method)">- (Object) <strong>serializable_hash</strong>(options = nil) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Base.html#as_json-instance_method" title="ActiveModelSerializers::Adapter::Base#as_json (method)">#as_json</a></span>, <span class='object_link'><a href="Base.html#cache_key-class_method" title="ActiveModelSerializers::Adapter::Base.cache_key (method)">cache_key</a></span>, <span class='object_link'><a href="Base.html#cache_key-instance_method" title="ActiveModelSerializers::Adapter::Base#cache_key (method)">#cache_key</a></span>, <span class='object_link'><a href="Base.html#default_key_transform-class_method" title="ActiveModelSerializers::Adapter::Base.default_key_transform (method)">default_key_transform</a></span>, <span class='object_link'><a href="Base.html#fragment_cache-instance_method" title="ActiveModelSerializers::Adapter::Base#fragment_cache (method)">#fragment_cache</a></span>, <span class='object_link'><a href="Base.html#fragment_cache-class_method" title="ActiveModelSerializers::Adapter::Base.fragment_cache (method)">fragment_cache</a></span>, <span class='object_link'><a href="Base.html#inherited-class_method" title="ActiveModelSerializers::Adapter::Base.inherited (method)">inherited</a></span>, <span class='object_link'><a href="Base.html#initialize-instance_method" title="ActiveModelSerializers::Adapter::Base#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Base.html#transform-class_method" title="ActiveModelSerializers::Adapter::Base.transform (method)">transform</a></span>, <span class='object_link'><a href="Base.html#transform_key_casing%21-class_method" title="ActiveModelSerializers::Adapter::Base.transform_key_casing! (method)">transform_key_casing!</a></span></p>
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Base.html#initialize-instance_method" title="ActiveModelSerializers::Adapter::Base#initialize (method)">ActiveModelSerializers::Adapter::Base</a></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="serializable_hash-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serializable_hash</strong>(options = nil)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/attributes.rb', line 4</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serializable_hash'>serializable_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='id identifier rubyid_serialization_options'>serialization_options</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='id identifier rubyid_instance_options'>instance_options</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_serializable_hash'>serializable_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_instance_options'>instance_options</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='kw'>self</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,329 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Adapter::Json
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModelSerializers/Adapter/Json.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (J)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span></span>
|
||||
»
|
||||
<span class="title">Json</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Adapter::Json
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Adapter::Json</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/adapter/json.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div id="subclasses">
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class="children"><span class='object_link'><a href="../../ActiveModel/Serializer/Adapter/Json.html" title="ActiveModel::Serializer::Adapter::Json (class)">ActiveModel::Serializer::Adapter::Json</a></span></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Base.html#instance_options-instance_method" title="ActiveModelSerializers::Adapter::Base#instance_options (method)">#instance_options</a></span>, <span class='object_link'><a href="Base.html#serializer-instance_method" title="ActiveModelSerializers::Adapter::Base#serializer (method)">#serializer</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#meta-instance_method" title="#meta (instance method)">- (Object) <strong>meta</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#meta_key-instance_method" title="#meta_key (instance method)">- (Object) <strong>meta_key</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serializable_hash-instance_method" title="#serializable_hash (instance method)">- (Object) <strong>serializable_hash</strong>(options = nil) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Base.html#as_json-instance_method" title="ActiveModelSerializers::Adapter::Base#as_json (method)">#as_json</a></span>, <span class='object_link'><a href="Base.html#cache_key-class_method" title="ActiveModelSerializers::Adapter::Base.cache_key (method)">cache_key</a></span>, <span class='object_link'><a href="Base.html#cache_key-instance_method" title="ActiveModelSerializers::Adapter::Base#cache_key (method)">#cache_key</a></span>, <span class='object_link'><a href="Base.html#default_key_transform-class_method" title="ActiveModelSerializers::Adapter::Base.default_key_transform (method)">default_key_transform</a></span>, <span class='object_link'><a href="Base.html#fragment_cache-instance_method" title="ActiveModelSerializers::Adapter::Base#fragment_cache (method)">#fragment_cache</a></span>, <span class='object_link'><a href="Base.html#fragment_cache-class_method" title="ActiveModelSerializers::Adapter::Base.fragment_cache (method)">fragment_cache</a></span>, <span class='object_link'><a href="Base.html#inherited-class_method" title="ActiveModelSerializers::Adapter::Base.inherited (method)">inherited</a></span>, <span class='object_link'><a href="Base.html#initialize-instance_method" title="ActiveModelSerializers::Adapter::Base#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Base.html#transform-class_method" title="ActiveModelSerializers::Adapter::Base.transform (method)">transform</a></span>, <span class='object_link'><a href="Base.html#transform_key_casing%21-class_method" title="ActiveModelSerializers::Adapter::Base.transform_key_casing! (method)">transform_key_casing!</a></span></p>
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Base.html#initialize-instance_method" title="ActiveModelSerializers::Adapter::Base#initialize (method)">ActiveModelSerializers::Adapter::Base</a></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="meta-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>meta</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
12
|
||||
13
|
||||
14</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json.rb', line 12</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_meta'>meta</span>
|
||||
<span class='id identifier rubyid_instance_options'>instance_options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:meta</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="meta_key-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>meta_key</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
16
|
||||
17
|
||||
18</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json.rb', line 16</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_meta_key'>meta_key</span>
|
||||
<span class='id identifier rubyid_instance_options'>instance_options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:meta_key</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>meta</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serializable_hash-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serializable_hash</strong>(options = nil)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json.rb', line 4</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serializable_hash'>serializable_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='id identifier rubyid_serialization_options'>serialization_options</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serialized_hash'>serialized_hash</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_root'>root</span> <span class='op'>=></span> <span class='const'>Attributes</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_instance_options'>instance_options</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_serializable_hash'>serializable_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_serialized_hash'>serialized_hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_meta_key'>meta_key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_meta'>meta</span> <span class='kw'>unless</span> <span class='id identifier rubyid_meta'>meta</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span>
|
||||
|
||||
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_transform_key_casing!'>transform_key_casing!</span><span class='lparen'>(</span><span class='id identifier rubyid_serialized_hash'>serialized_hash</span><span class='comma'>,</span> <span class='id identifier rubyid_instance_options'>instance_options</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,860 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Adapter::JsonApi
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModelSerializers/Adapter/JsonApi.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (J)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span></span>
|
||||
»
|
||||
<span class="title">JsonApi</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Adapter::JsonApi
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Adapter::JsonApi</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Extended by:</dt>
|
||||
<dd class="r2">ActiveSupport::Autoload</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/adapter/json_api.rb<span class="defines">,<br />
|
||||
lib/active_model_serializers/adapter/json_api/link.rb,<br /> lib/active_model_serializers/adapter/json_api/meta.rb,<br /> lib/active_model_serializers/adapter/json_api/error.rb,<br /> lib/active_model_serializers/adapter/json_api/jsonapi.rb,<br /> lib/active_model_serializers/adapter/json_api/relationship.rb,<br /> lib/active_model_serializers/adapter/json_api/deserialization.rb,<br /> lib/active_model_serializers/adapter/json_api/pagination_links.rb,<br /> lib/active_model_serializers/adapter/json_api/resource_identifier.rb</span>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div id="subclasses">
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class="children"><span class='object_link'><a href="../../ActiveModel/Serializer/Adapter/JsonApi.html" title="ActiveModel::Serializer::Adapter::JsonApi (class)">ActiveModel::Serializer::Adapter::JsonApi</a></span></p>
|
||||
</div>
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="JsonApi/Deserialization.html" title="ActiveModelSerializers::Adapter::JsonApi::Deserialization (module)">Deserialization</a></span>, <span class='object_link'><a href="JsonApi/Error.html" title="ActiveModelSerializers::Adapter::JsonApi::Error (module)">Error</a></span>, <span class='object_link'><a href="JsonApi/Jsonapi.html" title="ActiveModelSerializers::Adapter::JsonApi::Jsonapi (module)">Jsonapi</a></span>
|
||||
|
||||
|
||||
|
||||
<strong class="classes">Classes:</strong> <span class='object_link'><a href="JsonApi/Link.html" title="ActiveModelSerializers::Adapter::JsonApi::Link (class)">Link</a></span>, <span class='object_link'><a href="JsonApi/Meta.html" title="ActiveModelSerializers::Adapter::JsonApi::Meta (class)">Meta</a></span>, <span class='object_link'><a href="JsonApi/PaginationLinks.html" title="ActiveModelSerializers::Adapter::JsonApi::PaginationLinks (class)">PaginationLinks</a></span>, <span class='object_link'><a href="JsonApi/Relationship.html" title="ActiveModelSerializers::Adapter::JsonApi::Relationship (class)">Relationship</a></span>, <span class='object_link'><a href="JsonApi/ResourceIdentifier.html" title="ActiveModelSerializers::Adapter::JsonApi::ResourceIdentifier (class)">ResourceIdentifier</a></span>
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Base.html#instance_options-instance_method" title="ActiveModelSerializers::Adapter::Base#instance_options (method)">#instance_options</a></span>, <span class='object_link'><a href="Base.html#serializer-instance_method" title="ActiveModelSerializers::Adapter::Base#serializer (method)">#serializer</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#default_key_transform-class_method" title="default_key_transform (class method)">+ (Object) <strong>default_key_transform</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#fragment_cache-class_method" title="fragment_cache (class method)">+ (Object) <strong>fragment_cache</strong>(cached_hash, non_cached_hash, root = true) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#failure_document-instance_method" title="#failure_document (instance method)">- (Object) <strong>failure_document</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p><a href="http://jsonapi.org/format/#errors" target="_parent" title="JSON API Errors">JSON API Errors</a> TODO: look into caching
|
||||
definition: ☑ toplevel_errors array (required) ☐ toplevel_meta ☐
|
||||
toplevel_jsonapi structure: { errors: toplevel_errors, meta:
|
||||
toplevel_meta, jsonapi: toplevel_jsonapi }.reject! {|_,v| v.nil? }
|
||||
prs: https://github.com/rails-api/active_model_serializers/pull/1004.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#fragment_cache-instance_method" title="#fragment_cache (instance method)">- (Object) <strong>fragment_cache</strong>(cached_hash, non_cached_hash) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (JsonApi) <strong>initialize</strong>(serializer, options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of JsonApi.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serializable_hash-instance_method" title="#serializable_hash (instance method)">- (Object) <strong>serializable_hash</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p><a href="http://jsonapi.org/format/#crud" target="_parent" title="Requests are transactional, i.e. success or failure">Requests are transactional, i.e. success or failure</a> <a href="http://jsonapi.org/format/#document-top-level" target="_parent" title="data and errors MUST NOT coexist in the same document.">data and errors MUST NOT coexist in the same document.</a>.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#success_document-instance_method" title="#success_document (instance method)">- (Object) <strong>success_document</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p><a href="http://jsonapi.org/format/#document-top-level" target="_parent" title="Primary data">Primary data</a> definition:
|
||||
☐ toplevel_data (required) ☐ toplevel_included ☑ toplevel_meta ☑
|
||||
toplevel_links ☑ toplevel_jsonapi structure: { data: toplevel_data,
|
||||
included: toplevel_included, meta: toplevel_meta, links:
|
||||
toplevel_links, jsonapi: toplevel_jsonapi }.reject! {|_,v| v.nil? }
|
||||
rubocop:disable Metrics/CyclomaticComplexity.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Base.html#as_json-instance_method" title="ActiveModelSerializers::Adapter::Base#as_json (method)">#as_json</a></span>, <span class='object_link'><a href="Base.html#cache_key-instance_method" title="ActiveModelSerializers::Adapter::Base#cache_key (method)">#cache_key</a></span>, <span class='object_link'><a href="Base.html#cache_key-class_method" title="ActiveModelSerializers::Adapter::Base.cache_key (method)">cache_key</a></span>, <span class='object_link'><a href="Base.html#inherited-class_method" title="ActiveModelSerializers::Adapter::Base.inherited (method)">inherited</a></span>, <span class='object_link'><a href="Base.html#transform-class_method" title="ActiveModelSerializers::Adapter::Base.transform (method)">transform</a></span>, <span class='object_link'><a href="Base.html#transform_key_casing%21-class_method" title="ActiveModelSerializers::Adapter::Base.transform_key_casing! (method)">transform_key_casing!</a></span></p>
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Adapter::JsonApi (class)">JsonApi</a></span></tt>) <strong>initialize</strong>(serializer, options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of JsonApi</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
49
|
||||
50
|
||||
51
|
||||
52
|
||||
53</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api.rb', line 49</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span>
|
||||
<span class='ivar'>@include_directive</span> <span class='op'>=</span> <span class='const'>JSONAPI</span><span class='op'>::</span><span class='const'>IncludeDirective</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:include</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>allow_wildcard:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@fieldset</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fieldset</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span><span class='op'>::</span><span class='const'>Fieldset</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:fields</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="default_key_transform-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>default_key_transform</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
34
|
||||
35
|
||||
36</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api.rb', line 34</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default_key_transform'>default_key_transform</span>
|
||||
<span class='symbol'>:dash</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="fragment_cache-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>fragment_cache</strong>(cached_hash, non_cached_hash, root = true)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
38
|
||||
39
|
||||
40
|
||||
41
|
||||
42
|
||||
43
|
||||
44
|
||||
45
|
||||
46
|
||||
47</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api.rb', line 38</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_fragment_cache'>fragment_cache</span><span class='lparen'>(</span><span class='id identifier rubyid_cached_hash'>cached_hash</span><span class='comma'>,</span> <span class='id identifier rubyid_non_cached_hash'>non_cached_hash</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_core_cached'>core_cached</span> <span class='op'>=</span> <span class='id identifier rubyid_cached_hash'>cached_hash</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
||||
<span class='id identifier rubyid_core_non_cached'>core_non_cached</span> <span class='op'>=</span> <span class='id identifier rubyid_non_cached_hash'>non_cached_hash</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
||||
<span class='id identifier rubyid_no_root_cache'>no_root_cache</span> <span class='op'>=</span> <span class='id identifier rubyid_cached_hash'>cached_hash</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid__value'>_value</span><span class='op'>|</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>==</span> <span class='id identifier rubyid_core_cached'>core_cached</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_no_root_non_cache'>no_root_non_cache</span> <span class='op'>=</span> <span class='id identifier rubyid_non_cached_hash'>non_cached_hash</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid__value'>_value</span><span class='op'>|</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>==</span> <span class='id identifier rubyid_core_non_cached'>core_non_cached</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_cached_resource'>cached_resource</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_core_cached'>core_cached</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_core_cached'>core_cached</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_deep_merge'>deep_merge</span><span class='lparen'>(</span><span class='id identifier rubyid_core_non_cached'>core_non_cached</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_core_non_cached'>core_non_cached</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='id identifier rubyid_root'>root</span> <span class='op'>?</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_root'>root</span> <span class='op'>=></span> <span class='id identifier rubyid_cached_resource'>cached_resource</span> <span class='rbrace'>}</span> <span class='op'>:</span> <span class='id identifier rubyid_cached_resource'>cached_resource</span>
|
||||
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_deep_merge'>deep_merge</span> <span class='id identifier rubyid_no_root_non_cache'>no_root_non_cache</span><span class='period'>.</span><span class='id identifier rubyid_deep_merge'>deep_merge</span> <span class='id identifier rubyid_no_root_cache'>no_root_cache</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="failure_document-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>failure_document</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p><a href="http://jsonapi.org/format/#errors" target="_parent" title="JSON API Errors">JSON API Errors</a> TODO: look into caching
|
||||
definition:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_☑'>☑</span> <span class='id identifier rubyid_toplevel_errors'>toplevel_errors</span> <span class='id identifier rubyid_array'>array</span> <span class='lparen'>(</span><span class='id identifier rubyid_required'>required</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_☐'>☐</span> <span class='id identifier rubyid_toplevel_meta'>toplevel_meta</span>
|
||||
<span class='id identifier rubyid_☐'>☐</span> <span class='id identifier rubyid_toplevel_jsonapi'>toplevel_jsonapi</span>
|
||||
</code></pre>
|
||||
|
||||
<p>structure:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span>
|
||||
<span class='label'>errors:</span> <span class='id identifier rubyid_toplevel_errors'>toplevel_errors</span><span class='comma'>,</span>
|
||||
<span class='label'>meta:</span> <span class='id identifier rubyid_toplevel_meta'>toplevel_meta</span><span class='comma'>,</span>
|
||||
<span class='label'>jsonapi:</span> <span class='id identifier rubyid_toplevel_jsonapi'>toplevel_jsonapi</span>
|
||||
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_reject!'>reject!</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid__'>_</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>prs:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_https'>https</span><span class='symbol'>:/</span><span class='op'>/</span><span class='id identifier rubyid_github'>github</span><span class='period'>.</span><span class='id identifier rubyid_com'>com</span><span class='op'>/</span><span class='id identifier rubyid_rails'>rails</span><span class='op'>-</span><span class='id identifier rubyid_api'>api</span><span class='op'>/</span><span class='id identifier rubyid_active_model_serializers'>active_model_serializers</span><span class='op'>/</span><span class='id identifier rubyid_pull'>pull</span><span class='op'>/</span><span class='int'>1004</span>
|
||||
</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
170
|
||||
171
|
||||
172
|
||||
173
|
||||
174
|
||||
175
|
||||
176
|
||||
177
|
||||
178
|
||||
179
|
||||
180
|
||||
181
|
||||
182
|
||||
183
|
||||
184
|
||||
185
|
||||
186
|
||||
187
|
||||
188
|
||||
189
|
||||
190
|
||||
191</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api.rb', line 170</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_failure_document'>failure_document</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='comment'># PR Please :)
|
||||
</span> <span class='comment'># Jsonapi.add!(hash)
|
||||
</span>
|
||||
<span class='comment'># toplevel_errors
|
||||
</span> <span class='comment'># definition:
|
||||
</span> <span class='comment'># array of unique items of type 'error'
|
||||
</span> <span class='comment'># structure:
|
||||
</span> <span class='comment'># [
|
||||
</span> <span class='comment'># error,
|
||||
</span> <span class='comment'># error
|
||||
</span> <span class='comment'># ]
|
||||
</span> <span class='kw'>if</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:each</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:errors</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_flat_map'>flat_map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_error_serializer'>error_serializer</span><span class='op'>|</span>
|
||||
<span class='const'>Error</span><span class='period'>.</span><span class='id identifier rubyid_resource_errors'>resource_errors</span><span class='lparen'>(</span><span class='id identifier rubyid_error_serializer'>error_serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_instance_options'>instance_options</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:errors</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Error</span><span class='period'>.</span><span class='id identifier rubyid_resource_errors'>resource_errors</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_instance_options'>instance_options</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="fragment_cache-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>fragment_cache</strong>(cached_hash, non_cached_hash)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
66
|
||||
67
|
||||
68
|
||||
69</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api.rb', line 66</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_fragment_cache'>fragment_cache</span><span class='lparen'>(</span><span class='id identifier rubyid_cached_hash'>cached_hash</span><span class='comma'>,</span> <span class='id identifier rubyid_non_cached_hash'>non_cached_hash</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_root'>root</span> <span class='op'>=</span> <span class='op'>!</span><span class='id identifier rubyid_instance_options'>instance_options</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='symbol'>:include</span><span class='rparen'>)</span>
|
||||
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_fragment_cache'>fragment_cache</span><span class='lparen'>(</span><span class='id identifier rubyid_cached_hash'>cached_hash</span><span class='comma'>,</span> <span class='id identifier rubyid_non_cached_hash'>non_cached_hash</span><span class='comma'>,</span> <span class='id identifier rubyid_root'>root</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serializable_hash-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serializable_hash</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p><a href="http://jsonapi.org/format/#crud" target="_parent" title="Requests are transactional, i.e. success or failure">Requests are transactional, i.e. success or failure</a> <a href="http://jsonapi.org/format/#document-top-level" target="_parent" title="data and errors MUST NOT coexist in the same document.">data and errors MUST NOT coexist in the same document.</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
57
|
||||
58
|
||||
59
|
||||
60
|
||||
61
|
||||
62
|
||||
63
|
||||
64</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api.rb', line 57</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serializable_hash'>serializable_hash</span><span class='lparen'>(</span><span class='op'>*</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_document'>document</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_success?'>success?</span>
|
||||
<span class='id identifier rubyid_success_document'>success_document</span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='id identifier rubyid_failure_document'>failure_document</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_transform_key_casing!'>transform_key_casing!</span><span class='lparen'>(</span><span class='id identifier rubyid_document'>document</span><span class='comma'>,</span> <span class='id identifier rubyid_instance_options'>instance_options</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="success_document-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>success_document</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p><a href="http://jsonapi.org/format/#document-top-level" target="_parent" title="Primary data">Primary data</a> definition:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_☐'>☐</span> <span class='id identifier rubyid_toplevel_data'>toplevel_data</span> <span class='lparen'>(</span><span class='id identifier rubyid_required'>required</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_☐'>☐</span> <span class='id identifier rubyid_toplevel_included'>toplevel_included</span>
|
||||
<span class='id identifier rubyid_☑'>☑</span> <span class='id identifier rubyid_toplevel_meta'>toplevel_meta</span>
|
||||
<span class='id identifier rubyid_☑'>☑</span> <span class='id identifier rubyid_toplevel_links'>toplevel_links</span>
|
||||
<span class='id identifier rubyid_☑'>☑</span> <span class='id identifier rubyid_toplevel_jsonapi'>toplevel_jsonapi</span>
|
||||
</code></pre>
|
||||
|
||||
<p>structure:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span>
|
||||
<span class='label'>data:</span> <span class='id identifier rubyid_toplevel_data'>toplevel_data</span><span class='comma'>,</span>
|
||||
<span class='label'>included:</span> <span class='id identifier rubyid_toplevel_included'>toplevel_included</span><span class='comma'>,</span>
|
||||
<span class='label'>meta:</span> <span class='id identifier rubyid_toplevel_meta'>toplevel_meta</span><span class='comma'>,</span>
|
||||
<span class='label'>links:</span> <span class='id identifier rubyid_toplevel_links'>toplevel_links</span><span class='comma'>,</span>
|
||||
<span class='label'>jsonapi:</span> <span class='id identifier rubyid_toplevel_jsonapi'>toplevel_jsonapi</span>
|
||||
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_reject!'>reject!</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid__'>_</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>rubocop:disable Metrics/CyclomaticComplexity</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
87
|
||||
88
|
||||
89
|
||||
90
|
||||
91
|
||||
92
|
||||
93
|
||||
94
|
||||
95
|
||||
96
|
||||
97
|
||||
98
|
||||
99
|
||||
100
|
||||
101
|
||||
102
|
||||
103
|
||||
104
|
||||
105
|
||||
106
|
||||
107
|
||||
108
|
||||
109
|
||||
110
|
||||
111
|
||||
112
|
||||
113
|
||||
114
|
||||
115
|
||||
116
|
||||
117
|
||||
118
|
||||
119
|
||||
120
|
||||
121
|
||||
122
|
||||
123
|
||||
124
|
||||
125
|
||||
126
|
||||
127
|
||||
128
|
||||
129
|
||||
130
|
||||
131
|
||||
132
|
||||
133
|
||||
134
|
||||
135
|
||||
136
|
||||
137
|
||||
138
|
||||
139
|
||||
140
|
||||
141
|
||||
142
|
||||
143
|
||||
144
|
||||
145
|
||||
146
|
||||
147
|
||||
148
|
||||
149
|
||||
150
|
||||
151
|
||||
152
|
||||
153</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api.rb', line 87</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_success_document'>success_document</span>
|
||||
<span class='id identifier rubyid_is_collection'>is_collection</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:each</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serializers'>serializers</span> <span class='op'>=</span> <span class='id identifier rubyid_is_collection'>is_collection</span> <span class='op'>?</span> <span class='id identifier rubyid_serializer'>serializer</span> <span class='op'>:</span> <span class='lbracket'>[</span><span class='id identifier rubyid_serializer'>serializer</span><span class='rbracket'>]</span>
|
||||
<span class='id identifier rubyid_primary_data'>primary_data</span><span class='comma'>,</span> <span class='id identifier rubyid_included'>included</span> <span class='op'>=</span> <span class='id identifier rubyid_resource_objects_for'>resource_objects_for</span><span class='lparen'>(</span><span class='id identifier rubyid_serializers'>serializers</span><span class='rparen'>)</span>
|
||||
|
||||
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='comment'># toplevel_data
|
||||
</span> <span class='comment'># definition:
|
||||
</span> <span class='comment'># oneOf
|
||||
</span> <span class='comment'># resource
|
||||
</span> <span class='comment'># array of unique items of type 'resource'
|
||||
</span> <span class='comment'># null
|
||||
</span> <span class='comment'>#
|
||||
</span> <span class='comment'># description:
|
||||
</span> <span class='comment'># The document's "primary data" is a representation of the resource or collection of resources
|
||||
</span> <span class='comment'># targeted by a request.
|
||||
</span> <span class='comment'>#
|
||||
</span> <span class='comment'># Singular: the resource object.
|
||||
</span> <span class='comment'>#
|
||||
</span> <span class='comment'># Collection: one of an array of resource objects, an array of resource identifier objects, or
|
||||
</span> <span class='comment'># an empty array ([]), for requests that target resource collections.
|
||||
</span> <span class='comment'>#
|
||||
</span> <span class='comment'># None: null if the request is one that might correspond to a single resource, but doesn't currently.
|
||||
</span> <span class='comment'># structure:
|
||||
</span> <span class='comment'># if serializable_resource.resource?
|
||||
</span> <span class='comment'># resource
|
||||
</span> <span class='comment'># elsif serializable_resource.collection?
|
||||
</span> <span class='comment'># [
|
||||
</span> <span class='comment'># resource,
|
||||
</span> <span class='comment'># resource
|
||||
</span> <span class='comment'># ]
|
||||
</span> <span class='comment'># else
|
||||
</span> <span class='comment'># nil
|
||||
</span> <span class='comment'># end
|
||||
</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:data</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_is_collection'>is_collection</span> <span class='op'>?</span> <span class='id identifier rubyid_primary_data'>primary_data</span> <span class='op'>:</span> <span class='id identifier rubyid_primary_data'>primary_data</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
||||
<span class='comment'># toplevel_included
|
||||
</span> <span class='comment'># alias included
|
||||
</span> <span class='comment'># definition:
|
||||
</span> <span class='comment'># array of unique items of type 'resource'
|
||||
</span> <span class='comment'>#
|
||||
</span> <span class='comment'># description:
|
||||
</span> <span class='comment'># To reduce the number of HTTP requests, servers **MAY** allow
|
||||
</span> <span class='comment'># responses that include related resources along with the requested primary
|
||||
</span> <span class='comment'># resources. Such responses are called "compound documents".
|
||||
</span> <span class='comment'># structure:
|
||||
</span> <span class='comment'># [
|
||||
</span> <span class='comment'># resource,
|
||||
</span> <span class='comment'># resource
|
||||
</span> <span class='comment'># ]
|
||||
</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:included</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_included'>included</span> <span class='kw'>if</span> <span class='id identifier rubyid_included'>included</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
||||
|
||||
<span class='const'>Jsonapi</span><span class='period'>.</span><span class='id identifier rubyid_add!'>add!</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
|
||||
|
||||
<span class='kw'>if</span> <span class='id identifier rubyid_instance_options'>instance_options</span><span class='lbracket'>[</span><span class='symbol'>:links</span><span class='rbracket'>]</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:links</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:links</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_instance_options'>instance_options</span><span class='lbracket'>[</span><span class='symbol'>:links</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
|
||||
<span class='kw'>if</span> <span class='id identifier rubyid_is_collection'>is_collection</span> <span class='op'>&&</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_paginated?'>paginated?</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:links</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:links</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_pagination_links_for'>pagination_links_for</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:meta</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_options'>instance_options</span><span class='lbracket'>[</span><span class='symbol'>:meta</span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_instance_options'>instance_options</span><span class='lbracket'>[</span><span class='symbol'>:meta</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span>
|
||||
|
||||
<span class='id identifier rubyid_hash'>hash</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,471 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Adapter::JsonApi::Error
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModelSerializers/Adapter/JsonApi/Error.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (E)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../../Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span></span> » <span class='title'><span class='object_link'><a href="../JsonApi.html" title="ActiveModelSerializers::Adapter::JsonApi (class)">JsonApi</a></span></span>
|
||||
»
|
||||
<span class="title">Error</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Adapter::JsonApi::Error
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/adapter/json_api/error.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<dl class="constants">
|
||||
|
||||
<dt id="UnknownSourceTypeError-constant" class="">UnknownSourceTypeError =
|
||||
<div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>rubocop:disable Style/AsciiComments</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div>
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>ArgumentError</span><span class='rparen'>)</span></pre></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#attribute_error_objects-class_method" title="attribute_error_objects (class method)">+ (Object) <strong>attribute_error_objects</strong>(attribute_name, attribute_errors) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>definition: JSON Object.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#error_source-class_method" title="error_source (class method)">+ (Object) <strong>error_source</strong>(source_type, attribute_name) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>errorSource description: oneOf ☑ pointer : String ☑ parameter :
|
||||
String.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#resource_errors-class_method" title="resource_errors (class method)">+ (Array<Symbol, Array<String>>) <strong>resource_errors</strong>(error_serializer, options) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Builds a JSON API Errors Object <a href="http://jsonapi.org/format/#errors" target="_parent" title="JSON API Errors">JSON API Errors</a>.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="attribute_error_objects-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>attribute_error_objects</strong>(attribute_name, attribute_errors)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>definition:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='const'>JSON</span> <span class='const'>Object</span>
|
||||
</code></pre>
|
||||
|
||||
<p>properties:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">☐ id : String
|
||||
☐ status : String
|
||||
☐ code : String
|
||||
☐ title : String
|
||||
☑ detail : String
|
||||
☐ links
|
||||
☐ meta
|
||||
☑ error_source</code></pre>
|
||||
|
||||
<p>description:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">id : A unique identifier for this particular occurrence of the problem.
|
||||
status : The HTTP status code applicable to this problem, expressed as a string value
|
||||
code : An application-specific error code, expressed as a string value.
|
||||
title : A short, human-readable summary of the problem. It **SHOULD NOT** change from
|
||||
occurrence to occurrence of the problem, except for purposes of localization.
|
||||
detail : A human-readable explanation specific to this occurrence of the problem.</code></pre>
|
||||
|
||||
<p>structure:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span>
|
||||
<span class='label'>title:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SystemFailure</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
||||
<span class='label'>detail:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>something went terribly wrong</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
||||
<span class='label'>status:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>500</span><span class='tstring_end'>'</span></span>
|
||||
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_errorSource'>errorSource</span><span class='rparen'>)</span>
|
||||
</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
47
|
||||
48
|
||||
49
|
||||
50
|
||||
51
|
||||
52
|
||||
53
|
||||
54</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/error.rb', line 47</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attribute_error_objects'>attribute_error_objects</span><span class='lparen'>(</span><span class='id identifier rubyid_attribute_name'>attribute_name</span><span class='comma'>,</span> <span class='id identifier rubyid_attribute_errors'>attribute_errors</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_attribute_errors'>attribute_errors</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attribute_error'>attribute_error</span><span class='op'>|</span>
|
||||
<span class='lbrace'>{</span>
|
||||
<span class='label'>source:</span> <span class='id identifier rubyid_error_source'>error_source</span><span class='lparen'>(</span><span class='symbol'>:pointer</span><span class='comma'>,</span> <span class='id identifier rubyid_attribute_name'>attribute_name</span><span class='rparen'>)</span><span class='comma'>,</span>
|
||||
<span class='label'>detail:</span> <span class='id identifier rubyid_attribute_error'>attribute_error</span>
|
||||
<span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="error_source-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>error_source</strong>(source_type, attribute_name)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>errorSource description:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">oneOf
|
||||
☑ pointer : String
|
||||
☑ parameter : String</code></pre>
|
||||
|
||||
<p>description:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">pointer: A JSON Pointer RFC6901 to the associated entity in the request document e.g. "/data"
|
||||
for a primary data object, or "/data/attributes/title" for a specific attribute.
|
||||
https://tools.ietf.org/html/rfc6901
|
||||
|
||||
parameter: A string indicating which query parameter caused the error</code></pre>
|
||||
|
||||
<p>structure:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='kw'>if</span> <span class='id identifier rubyid_is_attribute?'>is_attribute?</span>
|
||||
<span class='lbrace'>{</span>
|
||||
<span class='label'>pointer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/data/attributes/red-button</span><span class='tstring_end'>'</span></span>
|
||||
<span class='rbrace'>}</span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='lbrace'>{</span>
|
||||
<span class='label'>parameter:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>pres</span><span class='tstring_end'>'</span></span>
|
||||
<span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span>
|
||||
</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
78
|
||||
79
|
||||
80
|
||||
81
|
||||
82
|
||||
83
|
||||
84
|
||||
85
|
||||
86
|
||||
87
|
||||
88
|
||||
89
|
||||
90
|
||||
91</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/error.rb', line 78</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_error_source'>error_source</span><span class='lparen'>(</span><span class='id identifier rubyid_source_type'>source_type</span><span class='comma'>,</span> <span class='id identifier rubyid_attribute_name'>attribute_name</span><span class='rparen'>)</span>
|
||||
<span class='kw'>case</span> <span class='id identifier rubyid_source_type'>source_type</span>
|
||||
<span class='kw'>when</span> <span class='symbol'>:pointer</span>
|
||||
<span class='lbrace'>{</span>
|
||||
<span class='label'>pointer:</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>JsonPointer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:attribute</span><span class='comma'>,</span> <span class='id identifier rubyid_attribute_name'>attribute_name</span><span class='rparen'>)</span>
|
||||
<span class='rbrace'>}</span>
|
||||
<span class='kw'>when</span> <span class='symbol'>:parameter</span>
|
||||
<span class='lbrace'>{</span>
|
||||
<span class='label'>parameter:</span> <span class='id identifier rubyid_attribute_name'>attribute_name</span>
|
||||
<span class='rbrace'>}</span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='id identifier rubyid_fail'>fail</span> <span class='const'>UnknownSourceTypeError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unknown source type '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_source_type'>source_type</span><span class='embexpr_end'>}</span><span class='tstring_content'>' for attribute_name '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attribute_name'>attribute_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>"</span></span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="resource_errors-class_method">
|
||||
|
||||
+ (<tt>Array<Symbol, Array<String>></tt>) <strong>resource_errors</strong>(error_serializer, options)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Builds a JSON API Errors Object <a href="http://jsonapi.org/format/#errors" target="_parent" title="JSON API Errors">JSON API Errors</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
<p class="tag_title">Parameters:</p>
|
||||
<ul class="param">
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>error_serializer</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt><span class='object_link'><a href="../../../ActiveModel/Serializer/ErrorSerializer.html" title="ActiveModel::Serializer::ErrorSerializer (class)">ActiveModel::Serializer::ErrorSerializer</a></span></tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Array<Symbol, Array<String>></tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>i.e. attribute_name, [attribute_errors]</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/error.rb', line 13</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_resource_errors'>resource_errors</span><span class='lparen'>(</span><span class='id identifier rubyid_error_serializer'>error_serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_error_serializer'>error_serializer</span><span class='period'>.</span><span class='id identifier rubyid_as_json'>as_json</span><span class='period'>.</span><span class='id identifier rubyid_flat_map'>flat_map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attribute_name'>attribute_name</span><span class='comma'>,</span> <span class='id identifier rubyid_attribute_errors'>attribute_errors</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_attribute_name'>attribute_name</span> <span class='op'>=</span> <span class='const'>JsonApi</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:transform_key_casing!</span><span class='comma'>,</span> <span class='id identifier rubyid_attribute_name'>attribute_name</span><span class='comma'>,</span>
|
||||
<span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_attribute_error_objects'>attribute_error_objects</span><span class='lparen'>(</span><span class='id identifier rubyid_attribute_name'>attribute_name</span><span class='comma'>,</span> <span class='id identifier rubyid_attribute_errors'>attribute_errors</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,365 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Adapter::JsonApi::Jsonapi
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModelSerializers/Adapter/JsonApi/Jsonapi.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (J)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../../Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span></span> » <span class='title'><span class='object_link'><a href="../JsonApi.html" title="ActiveModelSerializers::Adapter::JsonApi (class)">JsonApi</a></span></span>
|
||||
»
|
||||
<span class="title">Jsonapi</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Adapter::JsonApi::Jsonapi
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/adapter/json_api/jsonapi.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>toplevel_jsonapi definition:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='const'>JSON</span> <span class='const'>Object</span>
|
||||
</code></pre>
|
||||
|
||||
<p>properties:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">version : String
|
||||
meta</code></pre>
|
||||
|
||||
<p>description:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='const'>An</span> <span class='id identifier rubyid_object'>object</span> <span class='id identifier rubyid_describing'>describing</span> <span class='id identifier rubyid_the'>the</span> <span class='id identifier rubyid_server'>server</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>s implementation</span></span></code></pre>
|
||||
|
||||
<p>structure:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span>
|
||||
<span class='label'>version:</span> <span class='const'>ActiveModelSerializers</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_jsonapi_version'>jsonapi_version</span><span class='comma'>,</span>
|
||||
<span class='label'>meta:</span> <span class='const'>ActiveModelSerializers</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_jsonapi_toplevel_meta'>jsonapi_toplevel_meta</span>
|
||||
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_reject!'>reject!</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid__'>_</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='rbrace'>}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>prs:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_https'>https</span><span class='symbol'>:/</span><span class='op'>/</span><span class='id identifier rubyid_github'>github</span><span class='period'>.</span><span class='id identifier rubyid_com'>com</span><span class='op'>/</span><span class='id identifier rubyid_rails'>rails</span><span class='op'>-</span><span class='id identifier rubyid_api'>api</span><span class='op'>/</span><span class='id identifier rubyid_active_model_serializers'>active_model_serializers</span><span class='op'>/</span><span class='id identifier rubyid_pull'>pull</span><span class='op'>/</span><span class='int'>1050</span>
|
||||
</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#add%21-class_method" title="add! (class method)">+ (Object) <strong>add!</strong>(hash) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#include_object%3F-class_method" title="include_object? (class method)">+ (Boolean) <strong>include_object?</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#object-class_method" title="object (class method)">+ (Object) <strong>object</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>TODO: see if we can cache this.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="add!-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>add!</strong>(hash)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
26
|
||||
27
|
||||
28</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/jsonapi.rb', line 26</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_add!'>add!</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_include_object?'>include_object?</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="include_object?-class_method">
|
||||
|
||||
+ (<tt>Boolean</tt>) <strong>include_object?</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
30
|
||||
31
|
||||
32</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/jsonapi.rb', line 30</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_include_object?'>include_object?</span>
|
||||
<span class='const'>ActiveModelSerializers</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_jsonapi_include_toplevel_object'>jsonapi_include_toplevel_object</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="object-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>object</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>TODO: see if we can cache this</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
35
|
||||
36
|
||||
37
|
||||
38
|
||||
39
|
||||
40
|
||||
41
|
||||
42
|
||||
43
|
||||
44
|
||||
45</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/jsonapi.rb', line 35</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_object'>object</span>
|
||||
<span class='id identifier rubyid_object'>object</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
||||
<span class='label'>jsonapi:</span> <span class='lbrace'>{</span>
|
||||
<span class='label'>version:</span> <span class='const'>ActiveModelSerializers</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_jsonapi_version'>jsonapi_version</span><span class='comma'>,</span>
|
||||
<span class='label'>meta:</span> <span class='const'>ActiveModelSerializers</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_jsonapi_toplevel_meta'>jsonapi_toplevel_meta</span>
|
||||
<span class='rbrace'>}</span>
|
||||
<span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_object'>object</span><span class='lbracket'>[</span><span class='symbol'>:jsonapi</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_reject!'>reject!</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid__'>_</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='rbrace'>}</span>
|
||||
|
||||
<span class='id identifier rubyid_object'>object</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,475 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Adapter::JsonApi::Link
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModelSerializers/Adapter/JsonApi/Link.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (L)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../../Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span></span> » <span class='title'><span class='object_link'><a href="../JsonApi.html" title="ActiveModelSerializers::Adapter::JsonApi (class)">JsonApi</a></span></span>
|
||||
»
|
||||
<span class="title">Link</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Adapter::JsonApi::Link
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Adapter::JsonApi::Link</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Includes:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="../../SerializationContext/UrlHelpers.html" title="ActiveModelSerializers::SerializationContext::UrlHelpers (module)">SerializationContext::UrlHelpers</a></span></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/adapter/json_api/link.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>link definition:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_oneOf'>oneOf</span>
|
||||
<span class='id identifier rubyid_linkString'>linkString</span>
|
||||
<span class='id identifier rubyid_linkObject'>linkObject</span>
|
||||
</code></pre>
|
||||
|
||||
<p>description:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">A link **MUST** be represented as either: a string containing the link's URL or a link
|
||||
object."</code></pre>
|
||||
|
||||
<p>structure:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='kw'>if</span> <span class='id identifier rubyid_href?'>href?</span>
|
||||
<span class='id identifier rubyid_linkString'>linkString</span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='id identifier rubyid_linkObject'>linkObject</span>
|
||||
<span class='kw'>end</span>
|
||||
</code></pre>
|
||||
|
||||
<p>linkString definition:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='const'>URI</span>
|
||||
</code></pre>
|
||||
|
||||
<p>description:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='const'>A</span> <span class='id identifier rubyid_string'>string</span> <span class='id identifier rubyid_containing'>containing</span> <span class='id identifier rubyid_the'>the</span> <span class='id identifier rubyid_link'>link</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>s URL.</span></span></code></pre>
|
||||
|
||||
<p>structure:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http://example.com/link-string</span><span class='tstring_end'>'</span></span>
|
||||
</code></pre>
|
||||
|
||||
<p>linkObject definition:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='const'>JSON</span> <span class='const'>Object</span>
|
||||
</code></pre>
|
||||
|
||||
<p>properties:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">href (required) : URI
|
||||
meta</code></pre>
|
||||
|
||||
<p>structure:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span>
|
||||
<span class='label'>href:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http://example.com/link-object</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
||||
<span class='label'>meta:</span> <span class='id identifier rubyid_meta'>meta</span><span class='comma'>,</span>
|
||||
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_reject!'>reject!</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid__'>_</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
|
||||
</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#as_json-instance_method" title="#as_json (instance method)">- (Object) <strong>as_json</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#href-instance_method" title="#href (instance method)">- (Object) <strong>href</strong>(value) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Link) <strong>initialize</strong>(serializer, value) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of Link.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#meta-instance_method" title="#meta (instance method)">- (Object) <strong>meta</strong>(value) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../SerializationContext/UrlHelpers.html" title="ActiveModelSerializers::SerializationContext::UrlHelpers (module)">SerializationContext::UrlHelpers</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="../../SerializationContext/UrlHelpers.html#default_url_options-instance_method" title="ActiveModelSerializers::SerializationContext::UrlHelpers#default_url_options (method)">#default_url_options</a></span>, <span class='object_link'><a href="../../SerializationContext/UrlHelpers.html#included-class_method" title="ActiveModelSerializers::SerializationContext::UrlHelpers.included (method)">included</a></span></p>
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Adapter::JsonApi::Link (class)">Link</a></span></tt>) <strong>initialize</strong>(serializer, value)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of Link</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
44
|
||||
45
|
||||
46
|
||||
47
|
||||
48
|
||||
49
|
||||
50
|
||||
51
|
||||
52
|
||||
53
|
||||
54
|
||||
55</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/link.rb', line 44</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@_routes</span> <span class='op'>||=</span> <span class='kw'>nil</span> <span class='comment'># handles warning
|
||||
</span> <span class='comment'># actionpack-4.0.13/lib/action_dispatch/routing/route_set.rb:417: warning: instance variable @_routes not initialized
|
||||
</span> <span class='ivar'>@object</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_object'>object</span>
|
||||
<span class='ivar'>@scope</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_scope'>scope</span>
|
||||
<span class='comment'># Use the return value of the block unless it is nil.
|
||||
</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:call</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_eval'>instance_eval</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="as_json-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>as_json</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
67
|
||||
68
|
||||
69
|
||||
70
|
||||
71
|
||||
72
|
||||
73
|
||||
74
|
||||
75</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/link.rb', line 67</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span>
|
||||
<span class='kw'>return</span> <span class='ivar'>@value</span> <span class='kw'>if</span> <span class='ivar'>@value</span>
|
||||
|
||||
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:href</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='ivar'>@href</span> <span class='kw'>if</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='ivar'>@href</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:meta</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='ivar'>@meta</span> <span class='kw'>if</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='ivar'>@meta</span><span class='rparen'>)</span>
|
||||
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='op'>?</span> <span class='id identifier rubyid_hash'>hash</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="href-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>href</strong>(value)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
57
|
||||
58
|
||||
59
|
||||
60</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/link.rb', line 57</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_href'>href</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@href</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>nil</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="meta-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>meta</strong>(value)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
62
|
||||
63
|
||||
64
|
||||
65</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/link.rb', line 62</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_meta'>meta</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@meta</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>nil</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,301 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Adapter::JsonApi::Meta
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModelSerializers/Adapter/JsonApi/Meta.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (M)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../../Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span></span> » <span class='title'><span class='object_link'><a href="../JsonApi.html" title="ActiveModelSerializers::Adapter::JsonApi (class)">JsonApi</a></span></span>
|
||||
»
|
||||
<span class="title">Meta</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Adapter::JsonApi::Meta
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Adapter::JsonApi::Meta</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/adapter/json_api/meta.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>meta definition:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='const'>JSON</span> <span class='const'>Object</span>
|
||||
</code></pre>
|
||||
|
||||
<p>description:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">Non-standard meta-information that can not be represented as an attribute or relationship.</code></pre>
|
||||
|
||||
<p>structure:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span>
|
||||
<span class='label'>attitude:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>adjustable</span><span class='tstring_end'>'</span></span>
|
||||
<span class='rbrace'>}</span>
|
||||
</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#as_json-instance_method" title="#as_json (instance method)">- (Object) <strong>as_json</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Meta) <strong>initialize</strong>(serializer) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of Meta.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Adapter::JsonApi::Meta (class)">Meta</a></span></tt>) <strong>initialize</strong>(serializer)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of Meta</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/meta.rb', line 15</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@object</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_object'>object</span>
|
||||
<span class='ivar'>@scope</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_scope'>scope</span>
|
||||
|
||||
<span class='comment'># Use the return value of the block unless it is nil.
|
||||
</span> <span class='kw'>if</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid__meta'>_meta</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:call</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_eval'>instance_eval</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid__meta'>_meta</span><span class='rparen'>)</span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid__meta'>_meta</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="as_json-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>as_json</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
27
|
||||
28
|
||||
29</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/meta.rb', line 27</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span>
|
||||
<span class='ivar'>@value</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,440 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Adapter::JsonApi::PaginationLinks
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModelSerializers/Adapter/JsonApi/PaginationLinks.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (P)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../../Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span></span> » <span class='title'><span class='object_link'><a href="../JsonApi.html" title="ActiveModelSerializers::Adapter::JsonApi (class)">JsonApi</a></span></span>
|
||||
»
|
||||
<span class="title">PaginationLinks</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Adapter::JsonApi::PaginationLinks
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Adapter::JsonApi::PaginationLinks</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/adapter/json_api/pagination_links.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<dl class="constants">
|
||||
|
||||
<dt id="FIRST_PAGE-constant" class="">FIRST_PAGE =
|
||||
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='int'>1</span></pre></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#collection-instance_method" title="#collection (instance method)">- (Object) <strong>collection</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute collection.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#context-instance_method" title="#context (instance method)">- (Object) <strong>context</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute context.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#as_json-instance_method" title="#as_json (instance method)">- (Object) <strong>as_json</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (PaginationLinks) <strong>initialize</strong>(collection, adapter_options) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of PaginationLinks.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Adapter::JsonApi::PaginationLinks (class)">PaginationLinks</a></span></tt>) <strong>initialize</strong>(collection, adapter_options)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of PaginationLinks</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/pagination_links.rb', line 9</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_collection'>collection</span><span class='comma'>,</span> <span class='id identifier rubyid_adapter_options'>adapter_options</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@collection</span> <span class='op'>=</span> <span class='id identifier rubyid_collection'>collection</span>
|
||||
<span class='ivar'>@adapter_options</span> <span class='op'>=</span> <span class='id identifier rubyid_adapter_options'>adapter_options</span>
|
||||
<span class='ivar'>@context</span> <span class='op'>=</span> <span class='id identifier rubyid_adapter_options'>adapter_options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:serialization_context</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="instance_attr_details" class="attr_details">
|
||||
<h2>Instance Attribute Details</h2>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="collection-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>collection</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute collection</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
7
|
||||
8
|
||||
9</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/pagination_links.rb', line 7</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_collection'>collection</span>
|
||||
<span class='ivar'>@collection</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="context-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>context</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute context</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
7
|
||||
8
|
||||
9</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/pagination_links.rb', line 7</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_context'>context</span>
|
||||
<span class='ivar'>@context</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="as_json-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>as_json</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/pagination_links.rb', line 15</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span>
|
||||
<span class='id identifier rubyid_per_page'>per_page</span> <span class='op'>=</span> <span class='id identifier rubyid_collection'>collection</span><span class='period'>.</span><span class='id identifier rubyid_try'>try</span><span class='lparen'>(</span><span class='symbol'>:per_page</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_collection'>collection</span><span class='period'>.</span><span class='id identifier rubyid_try'>try</span><span class='lparen'>(</span><span class='symbol'>:limit_value</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_collection'>collection</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
|
||||
<span class='id identifier rubyid_pages_from'>pages_from</span><span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_hash'>hash</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='id identifier rubyid_query_parameters'>query_parameters</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='label'>page:</span> <span class='lbrace'>{</span> <span class='label'>number:</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='label'>size:</span> <span class='id identifier rubyid_per_page'>per_page</span> <span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_query'>to_query</span>
|
||||
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_url'>url</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_options'>adapter_options</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>?</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_params'>params</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,296 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Adapter::JsonApi::Relationship
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModelSerializers/Adapter/JsonApi/Relationship.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (R)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../../Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span></span> » <span class='title'><span class='object_link'><a href="../JsonApi.html" title="ActiveModelSerializers::Adapter::JsonApi (class)">JsonApi</a></span></span>
|
||||
»
|
||||
<span class="title">Relationship</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Adapter::JsonApi::Relationship
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Adapter::JsonApi::Relationship</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/adapter/json_api/relationship.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#as_json-instance_method" title="#as_json (instance method)">- (Object) <strong>as_json</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Relationship) <strong>initialize</strong>(parent_serializer, serializer, serializable_resource_options, args = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p><a href="http://jsonapi.org/format/#document-resource-object-related-resource-links" target="_parent" title="Document Resource Object Related Resource Links">Document Resource Object Related Resource Links</a>
|
||||
<a href="http://jsonapi.org/format/#document-links" target="_parent" title="Document Links">Document Links</a>
|
||||
<a href="http://jsonapi.org/format/#document-resource-object-linkage" target="_parent" title="Document Resource Relationship Linkage">Document Resource Relationship Linkage</a> <a href="http://jsonapi.org/format/#document-meta" target="_parent" title="Docment Meta">Docment Meta</a>.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Adapter::JsonApi::Relationship (class)">Relationship</a></span></tt>) <strong>initialize</strong>(parent_serializer, serializer, serializable_resource_options, args = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p><a href="http://jsonapi.org/format/#document-resource-object-related-resource-links" target="_parent" title="Document Resource Object Related Resource Links">Document Resource Object Related Resource Links</a>
|
||||
<a href="http://jsonapi.org/format/#document-links" target="_parent" title="Document Links">Document Links</a>
|
||||
<a href="http://jsonapi.org/format/#document-resource-object-linkage" target="_parent" title="Document Resource Relationship Linkage">Document Resource Relationship Linkage</a> <a href="http://jsonapi.org/format/#document-meta" target="_parent" title="Docment Meta">Docment Meta</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/relationship.rb', line 9</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_parent_serializer'>parent_serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_serializable_resource_options'>serializable_resource_options</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@object</span> <span class='op'>=</span> <span class='id identifier rubyid_parent_serializer'>parent_serializer</span><span class='period'>.</span><span class='id identifier rubyid_object'>object</span>
|
||||
<span class='ivar'>@scope</span> <span class='op'>=</span> <span class='id identifier rubyid_parent_serializer'>parent_serializer</span><span class='period'>.</span><span class='id identifier rubyid_scope'>scope</span>
|
||||
<span class='ivar'>@association_options</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:options</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@serializable_resource_options</span> <span class='op'>=</span> <span class='id identifier rubyid_serializable_resource_options'>serializable_resource_options</span>
|
||||
<span class='ivar'>@data</span> <span class='op'>=</span> <span class='id identifier rubyid_data_for'>data_for</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@links</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:links</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_hash'>hash</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Adapter</span><span class='op'>::</span><span class='const'>JsonApi</span><span class='op'>::</span><span class='const'>Link</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_parent_serializer'>parent_serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_as_json'>as_json</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='id identifier rubyid_meta'>meta</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:meta</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@meta</span> <span class='op'>=</span> <span class='id identifier rubyid_meta'>meta</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:call</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_parent_serializer'>parent_serializer</span><span class='period'>.</span><span class='id identifier rubyid_instance_eval'>instance_eval</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_meta'>meta</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_meta'>meta</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="as_json-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>as_json</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26
|
||||
27
|
||||
28
|
||||
29
|
||||
30
|
||||
31</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/relationship.rb', line 22</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:data</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span> <span class='kw'>if</span> <span class='id identifier rubyid_association_options'>association_options</span><span class='lbracket'>[</span><span class='symbol'>:include_data</span><span class='rbracket'>]</span>
|
||||
<span class='id identifier rubyid_links'>links</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_links'>links</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:links</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_links'>links</span> <span class='kw'>if</span> <span class='id identifier rubyid_links'>links</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
||||
<span class='id identifier rubyid_meta'>meta</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_meta'>meta</span>
|
||||
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:meta</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_meta'>meta</span> <span class='kw'>if</span> <span class='id identifier rubyid_meta'>meta</span>
|
||||
|
||||
<span class='id identifier rubyid_hash'>hash</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,264 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Adapter::JsonApi::ResourceIdentifier
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModelSerializers/Adapter/JsonApi/ResourceIdentifier.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (R)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../../Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span></span> » <span class='title'><span class='object_link'><a href="../JsonApi.html" title="ActiveModelSerializers::Adapter::JsonApi (class)">JsonApi</a></span></span>
|
||||
»
|
||||
<span class="title">ResourceIdentifier</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Adapter::JsonApi::ResourceIdentifier
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Adapter::JsonApi::ResourceIdentifier</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/adapter/json_api/resource_identifier.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#as_json-instance_method" title="#as_json (instance method)">- (Object) <strong>as_json</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (ResourceIdentifier) <strong>initialize</strong>(serializer, options) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p><a href="http://jsonapi.org/format/#document-resource-identifier-objects" target="_parent" title="Resource Identifier Objects">Resource Identifier Objects</a>.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Adapter::JsonApi::ResourceIdentifier (class)">ResourceIdentifier</a></span></tt>) <strong>initialize</strong>(serializer, options)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p><a href="http://jsonapi.org/format/#document-resource-identifier-objects" target="_parent" title="Resource Identifier Objects">Resource Identifier Objects</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/resource_identifier.rb', line 6</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@id</span> <span class='op'>=</span> <span class='id identifier rubyid_id_for'>id_for</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@type</span> <span class='op'>=</span> <span class='const'>JsonApi</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:transform_key_casing!</span><span class='comma'>,</span> <span class='id identifier rubyid_type_for'>type_for</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='rparen'>)</span><span class='comma'>,</span>
|
||||
<span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="as_json-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>as_json</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
12
|
||||
13
|
||||
14</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/json_api/resource_identifier.rb', line 12</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span>
|
||||
<span class='lbrace'>{</span> <span class='label'>id:</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='label'>type:</span> <span class='id identifier rubyid_type'>type</span> <span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,217 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Adapter::Null
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModelSerializers/Adapter/Null.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (N)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span></span>
|
||||
»
|
||||
<span class="title">Null</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Adapter::Null
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Adapter::Null</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/adapter/null.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div id="subclasses">
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class="children"><span class='object_link'><a href="../../ActiveModel/Serializer/Adapter/Null.html" title="ActiveModel::Serializer::Adapter::Null (class)">ActiveModel::Serializer::Adapter::Null</a></span></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Base.html#instance_options-instance_method" title="ActiveModelSerializers::Adapter::Base#instance_options (method)">#instance_options</a></span>, <span class='object_link'><a href="Base.html#serializer-instance_method" title="ActiveModelSerializers::Adapter::Base#serializer (method)">#serializer</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serializable_hash-instance_method" title="#serializable_hash (instance method)">- (Object) <strong>serializable_hash</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Base.html#as_json-instance_method" title="ActiveModelSerializers::Adapter::Base#as_json (method)">#as_json</a></span>, <span class='object_link'><a href="Base.html#cache_key-class_method" title="ActiveModelSerializers::Adapter::Base.cache_key (method)">cache_key</a></span>, <span class='object_link'><a href="Base.html#cache_key-instance_method" title="ActiveModelSerializers::Adapter::Base#cache_key (method)">#cache_key</a></span>, <span class='object_link'><a href="Base.html#default_key_transform-class_method" title="ActiveModelSerializers::Adapter::Base.default_key_transform (method)">default_key_transform</a></span>, <span class='object_link'><a href="Base.html#fragment_cache-instance_method" title="ActiveModelSerializers::Adapter::Base#fragment_cache (method)">#fragment_cache</a></span>, <span class='object_link'><a href="Base.html#fragment_cache-class_method" title="ActiveModelSerializers::Adapter::Base.fragment_cache (method)">fragment_cache</a></span>, <span class='object_link'><a href="Base.html#inherited-class_method" title="ActiveModelSerializers::Adapter::Base.inherited (method)">inherited</a></span>, <span class='object_link'><a href="Base.html#initialize-instance_method" title="ActiveModelSerializers::Adapter::Base#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Base.html#transform-class_method" title="ActiveModelSerializers::Adapter::Base.transform (method)">transform</a></span>, <span class='object_link'><a href="Base.html#transform_key_casing%21-class_method" title="ActiveModelSerializers::Adapter::Base.transform_key_casing! (method)">transform_key_casing!</a></span></p>
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Base.html#initialize-instance_method" title="ActiveModelSerializers::Adapter::Base#initialize (method)">ActiveModelSerializers::Adapter::Base</a></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="serializable_hash-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serializable_hash</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
4
|
||||
5
|
||||
6</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/adapter/null.rb', line 4</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serializable_hash'>serializable_hash</span><span class='lparen'>(</span><span class='op'>*</span><span class='rparen'>)</span>
|
||||
<span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,142 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Callbacks
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/Callbacks.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">Callbacks</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Callbacks
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Concern</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Includes:</dt>
|
||||
<dd class="r2">ActiveSupport::Callbacks</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/callbacks.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<h1 id="label-ActiveModelSerializers+Callbacks">ActiveModelSerializers Callbacks</h1>
|
||||
|
||||
<p>ActiveModelSerializers provides hooks during the life cycle of
|
||||
serialization and allow you to trigger logic. Available callbacks are:</p>
|
||||
<ul><li>
|
||||
<p><code>around_render</code></p>
|
||||
</li></ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Callbacks/ClassMethods.html" title="ActiveModelSerializers::Callbacks::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,225 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Callbacks::ClassMethods
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModelSerializers/Callbacks/ClassMethods.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../Callbacks.html" title="ActiveModelSerializers::Callbacks (module)">Callbacks</a></span></span>
|
||||
»
|
||||
<span class="title">ClassMethods</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Callbacks::ClassMethods
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/callbacks.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>These methods will be included into any ActiveModelSerializers object,
|
||||
adding callbacks for <code>render</code>.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#around_render-instance_method" title="#around_render (instance method)">- (Object) <strong>around_render</strong>(*filters, &blk) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Defines a callback that will get called around the render method, whether
|
||||
it is as_json, to_json, or serializable_hash.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="around_render-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>around_render</strong>(*filters, &blk)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Defines a callback that will get called around the render method, whether
|
||||
it is as_json, to_json, or serializable_hash</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>SerializableResource</span>
|
||||
<span class='id identifier rubyid_include'>include</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Callbacks</span>
|
||||
|
||||
<span class='id identifier rubyid_around_render'>around_render</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_tag_logger'>tag_logger</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_notify_render'>notify_render</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span>
|
||||
<span class='id identifier rubyid_run_callbacks'>run_callbacks</span> <span class='symbol'>:render</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_as_json'>as_json</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='comment'># Note: So that we can re-use the instrumenter for as_json, to_json, and
|
||||
</span> <span class='comment'># serializable_hash, we aren't using the usual format, which would be:
|
||||
</span> <span class='comment'># def render(args)
|
||||
</span> <span class='comment'># adapter.as_json
|
||||
</span> <span class='comment'># end
|
||||
</span><span class='kw'>end</span>
|
||||
</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
50
|
||||
51
|
||||
52</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/callbacks.rb', line 50</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_around_render'>around_render</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_filters'>filters</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_blk'>blk</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_set_callback'>set_callback</span><span class='lparen'>(</span><span class='symbol'>:render</span><span class='comma'>,</span> <span class='symbol'>:around</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_filters'>filters</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_blk'>blk</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,271 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Deprecate
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/Deprecate.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (D)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">Deprecate</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Deprecate
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Included in:</dt>
|
||||
<dd class="r1"><span class='object_link'><a href="../ActiveModel/SerializableResource.html" title="ActiveModel::SerializableResource (class)">ActiveModel::SerializableResource</a></span>, <span class='object_link'><a href="../ActiveModel/Serializer.html" title="ActiveModel::Serializer (class)">ActiveModel::Serializer</a></span>, <span class='object_link'><a href="../ActiveModel/Serializer/Adapter.html" title="ActiveModel::Serializer::Adapter (module)">ActiveModel::Serializer::Adapter</a></span>, <span class='object_link'><a href="../ActiveModel/Serializer/Adapter/Attributes.html" title="ActiveModel::Serializer::Adapter::Attributes (class)">ActiveModel::Serializer::Adapter::Attributes</a></span>, <span class='object_link'><a href="../ActiveModel/Serializer/Adapter/Base.html" title="ActiveModel::Serializer::Adapter::Base (class)">ActiveModel::Serializer::Adapter::Base</a></span>, <span class='object_link'><a href="../ActiveModel/Serializer/Adapter/Json.html" title="ActiveModel::Serializer::Adapter::Json (class)">ActiveModel::Serializer::Adapter::Json</a></span>, <span class='object_link'><a href="../ActiveModel/Serializer/Adapter/JsonApi.html" title="ActiveModel::Serializer::Adapter::JsonApi (class)">ActiveModel::Serializer::Adapter::JsonApi</a></span>, <span class='object_link'><a href="../ActiveModel/Serializer/Adapter/Null.html" title="ActiveModel::Serializer::Adapter::Null (class)">ActiveModel::Serializer::Adapter::Null</a></span>, <span class='object_link'><a href="../ActiveModel/Serializer/ArraySerializer.html" title="ActiveModel::Serializer::ArraySerializer (class)">ActiveModel::Serializer::ArraySerializer</a></span></dd>
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/deprecate.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#delegate_and_deprecate-class_method" title="delegate_and_deprecate (class method)">+ (Object) <strong>delegate_and_deprecate</strong>(method, delegee) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#deprecate-class_method" title="deprecate (class method)">+ (Object) <strong>deprecate</strong>(name, replacement) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Simple deprecation method that deprecates <code>name</code> by wrapping it
|
||||
up in a dummy method.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="delegate_and_deprecate-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>delegate_and_deprecate</strong>(method, delegee)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
46
|
||||
47
|
||||
48
|
||||
49</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/deprecate.rb', line 46</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_delegate_and_deprecate'>delegate_and_deprecate</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_delegee'>delegee</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_delegate'>delegate</span> <span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='label'>to:</span> <span class='id identifier rubyid_delegee'>delegee</span>
|
||||
<span class='id identifier rubyid_deprecate'>deprecate</span> <span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_delegee'>delegee</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="deprecate-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>deprecate</strong>(name, replacement)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Simple deprecation method that deprecates <code>name</code> by wrapping it
|
||||
up in a dummy method. It warns on each call to the dummy method telling the
|
||||
user of <code>replacement</code> (unless <code>replacement</code> is :none)
|
||||
that it is planned to go away.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37
|
||||
38
|
||||
39
|
||||
40
|
||||
41
|
||||
42
|
||||
43
|
||||
44</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/deprecate.rb', line 31</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_deprecate'>deprecate</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_replacement'>replacement</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_old'>old</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_deprecated_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
||||
<span class='id identifier rubyid_alias_method'>alias_method</span> <span class='id identifier rubyid_old'>old</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span>
|
||||
<span class='id identifier rubyid_class_eval'>class_eval</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Module</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_content'>#</span><span class='tstring_end'>"</span></span>
|
||||
<span class='id identifier rubyid_msg'>msg</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>NOTE: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target'>target</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> is deprecated</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
||||
<span class='id identifier rubyid_replacement'>replacement</span> <span class='op'>==</span> <span class='symbol'>:none</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> with no replacement</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>; use </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_replacement'>replacement</span><span class='embexpr_end'>}</span><span class='tstring_content'> instead</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
||||
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target'>target</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> called from </span><span class='embexpr_beg'>#{</span><span class='const'>ActiveModelSerializers</span><span class='period'>.</span><span class='id identifier rubyid_location_of_caller'>location_of_caller</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>:</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span>
|
||||
<span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_msg'>msg</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span>
|
||||
<span class='id identifier rubyid_send'>send</span> <span class='id identifier rubyid_old'>old</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,239 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Deserialization
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/Deserialization.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (D)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">Deserialization</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Deserialization
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/deserialization.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#jsonapi_parse-class_method" title="jsonapi_parse (class method)">+ (Object) <strong>jsonapi_parse</strong>(*args) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#jsonapi_parse%21-class_method" title="jsonapi_parse! (class method)">+ (Object) <strong>jsonapi_parse!</strong>(*args) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>:nocov:.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="jsonapi_parse-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>jsonapi_parse</strong>(*args)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
5
|
||||
6
|
||||
7</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/deserialization.rb', line 5</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_jsonapi_parse'>jsonapi_parse</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
||||
<span class='const'>Adapter</span><span class='op'>::</span><span class='const'>JsonApi</span><span class='op'>::</span><span class='const'>Deserialization</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="jsonapi_parse!-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>jsonapi_parse!</strong>(*args)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>:nocov:</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
10
|
||||
11
|
||||
12</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/deserialization.rb', line 10</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_jsonapi_parse!'>jsonapi_parse!</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
||||
<span class='const'>Adapter</span><span class='op'>::</span><span class='const'>JsonApi</span><span class='op'>::</span><span class='const'>Deserialization</span><span class='period'>.</span><span class='id identifier rubyid_parse!'>parse!</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,189 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::JsonPointer
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/JsonPointer.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (J)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">JsonPointer</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::JsonPointer
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/json_pointer.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<dl class="constants">
|
||||
|
||||
<dt id="POINTERS-constant" class="">POINTERS =
|
||||
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='lbrace'>{</span>
|
||||
<span class='label'>attribute:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/data/attributes/%s</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span>
|
||||
<span class='label'>primary_data:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/data%s</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
|
||||
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#new-class_method" title="new (class method)">+ (Object) <strong>new</strong>(pointer_type, value = nil) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="new-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>new</strong>(pointer_type, value = nil)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
10
|
||||
11
|
||||
12</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/json_pointer.rb', line 10</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_pointer_type'>pointer_type</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='const'>POINTERS</span><span class='lbracket'>[</span><span class='id identifier rubyid_pointer_type'>pointer_type</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,352 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Jsonapi
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/Jsonapi.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (J)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">Jsonapi</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Jsonapi
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/register_jsonapi_renderer.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Based on discussion in <a
|
||||
href="https://github.com/rails/rails/pull/23712#issuecomment-184977238">github.com/rails/rails/pull/23712#issuecomment-184977238</a>,
|
||||
the JSON API media type will have its own format/renderer.</p>
|
||||
|
||||
<p>> We recommend the media type be registered on its own as jsonapi when a
|
||||
jsonapi Renderer and deserializer (Http::Parameters::DEFAULT_PARSERS) are
|
||||
added.</p>
|
||||
|
||||
<p>Usage:</p>
|
||||
|
||||
<p>ActiveSupport.on_load(:action_controller) do</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>active_model_serializers/register_jsonapi_renderer</span><span class='tstring_end'>'</span></span>
|
||||
</code></pre>
|
||||
|
||||
<p>end</p>
|
||||
|
||||
<p>And then in controllers, use `render jsonapi: model` rather than `render
|
||||
json: model, adapter: :json_api`.</p>
|
||||
|
||||
<p>For example, in a controller action, we can: respond_to do |format|</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_jsonapi'>jsonapi</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_render'>render</span> <span class='label'>jsonapi:</span> <span class='id identifier rubyid_model'>model</span> <span class='rbrace'>}</span>
|
||||
</code></pre>
|
||||
|
||||
<p>end</p>
|
||||
|
||||
<p>or</p>
|
||||
|
||||
<p>render jsonapi: model</p>
|
||||
|
||||
<p>No wrapper format needed as it does not apply (i.e. no `wrap_parameters
|
||||
format: [jsonapi]`)</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Jsonapi/ControllerSupport.html" title="ActiveModelSerializers::Jsonapi::ControllerSupport (module)">ControllerSupport</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<dl class="constants">
|
||||
|
||||
<dt id="MEDIA_TYPE-constant" class="">MEDIA_TYPE =
|
||||
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>application/vnd.api+json</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
||||
|
||||
<dt id="HEADERS-constant" class="">HEADERS =
|
||||
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='lbrace'>{</span>
|
||||
<span class='label'>response:</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>CONTENT_TYPE</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span> <span class='op'>=></span> <span class='const'>MEDIA_TYPE</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
||||
<span class='label'>request:</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ACCEPT</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span> <span class='op'>=></span> <span class='const'>MEDIA_TYPE</span> <span class='rbrace'>}</span>
|
||||
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#install-class_method" title="install (class method)">+ (Object) <strong>install</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#parser-class_method" title="parser (class method)">+ (Object) <strong>parser</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Proposal: should actually deserialize the JSON API params to the hash
|
||||
format expected by `ActiveModel::Serializers::JSON`
|
||||
actionpack/lib/action_dispatch/http/parameters.rb.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="install-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>install</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37
|
||||
38
|
||||
39
|
||||
40
|
||||
41
|
||||
42
|
||||
43
|
||||
44
|
||||
45
|
||||
46
|
||||
47
|
||||
48</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/register_jsonapi_renderer.rb', line 32</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_install'>install</span>
|
||||
<span class='comment'># actionpack/lib/action_dispatch/http/mime_types.rb
|
||||
</span> <span class='const'>Mime</span><span class='op'>::</span><span class='const'>Type</span><span class='period'>.</span><span class='id identifier rubyid_register'>register</span> <span class='const'>MEDIA_TYPE</span><span class='comma'>,</span> <span class='symbol'>:jsonapi</span>
|
||||
|
||||
<span class='kw'>if</span> <span class='const'>Rails</span><span class='op'>::</span><span class='const'>VERSION</span><span class='op'>::</span><span class='const'>MAJOR</span> <span class='op'>>=</span> <span class='int'>5</span>
|
||||
<span class='const'>ActionDispatch</span><span class='op'>::</span><span class='const'>Request</span><span class='period'>.</span><span class='id identifier rubyid_parameter_parsers'>parameter_parsers</span><span class='lbracket'>[</span><span class='symbol'>:jsonapi</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_parser'>parser</span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='const'>ActionDispatch</span><span class='op'>::</span><span class='const'>ParamsParser</span><span class='op'>::</span><span class='const'>DEFAULT_PARSERS</span><span class='lbracket'>[</span><span class='const'>Mime</span><span class='lbracket'>[</span><span class='symbol'>:jsonapi</span><span class='rbracket'>]</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_parser'>parser</span>
|
||||
<span class='kw'>end</span>
|
||||
|
||||
<span class='comment'># ref https://github.com/rails/rails/pull/21496
|
||||
</span> <span class='const'>ActionController</span><span class='op'>::</span><span class='const'>Renderers</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='symbol'>:jsonapi</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_json'>json</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_json'>json</span> <span class='op'>=</span> <span class='id identifier rubyid_serialize_jsonapi'>serialize_jsonapi</span><span class='lparen'>(</span><span class='id identifier rubyid_json'>json</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_json'>json</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
|
||||
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_content_type'>content_type</span> <span class='op'>||=</span> <span class='const'>Mime</span><span class='lbracket'>[</span><span class='symbol'>:jsonapi</span><span class='rbracket'>]</span>
|
||||
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_response_body'>response_body</span> <span class='op'>=</span> <span class='id identifier rubyid_json'>json</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="parser-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>parser</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Proposal: should actually deserialize the JSON API params to the hash
|
||||
format expected by `ActiveModel::Serializers::JSON`
|
||||
actionpack/lib/action_dispatch/http/parameters.rb</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
53
|
||||
54
|
||||
55
|
||||
56
|
||||
57
|
||||
58
|
||||
59</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/register_jsonapi_renderer.rb', line 53</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parser'>parser</span>
|
||||
<span class='id identifier rubyid_lambda'>lambda</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_body'>body</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='symbol'>:_json</span> <span class='op'>=></span> <span class='id identifier rubyid_data'>data</span> <span class='rbrace'>}</span> <span class='kw'>unless</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_with_indifferent_access'>with_indifferent_access</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,182 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Jsonapi::ControllerSupport
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModelSerializers/Jsonapi/ControllerSupport.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../Jsonapi.html" title="ActiveModelSerializers::Jsonapi (module)">Jsonapi</a></span></span>
|
||||
»
|
||||
<span class="title">ControllerSupport</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Jsonapi::ControllerSupport
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/register_jsonapi_renderer.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serialize_jsonapi-instance_method" title="#serialize_jsonapi (instance method)">- (Object) <strong>serialize_jsonapi</strong>(json, options) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="serialize_jsonapi-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serialize_jsonapi</strong>(json, options)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
62
|
||||
63
|
||||
64
|
||||
65
|
||||
66
|
||||
67
|
||||
68</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/register_jsonapi_renderer.rb', line 62</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serialize_jsonapi'>serialize_jsonapi</span><span class='lparen'>(</span><span class='id identifier rubyid_json'>json</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:adapter</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='symbol'>:json_api</span>
|
||||
<span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:serialization_context</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:serialization_context</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>SerializationContext</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='id identifier rubyid_get_serializer'>get_serializer</span><span class='lparen'>(</span><span class='id identifier rubyid_json'>json</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,533 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::KeyTransform
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/KeyTransform.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (K)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">KeyTransform</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::KeyTransform
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/key_transform.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#camel-class_method" title="camel (class method)">+ (Object) <strong>camel</strong>(value) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Transforms values to UpperCamelCase or PascalCase.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#camel_lower-class_method" title="camel_lower (class method)">+ (Object) <strong>camel_lower</strong>(value) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Transforms values to camelCase.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#dash-class_method" title="dash (class method)">+ (Object) <strong>dash</strong>(value) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Transforms values to dashed-case.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#unaltered-class_method" title="unaltered (class method)">+ (Object) <strong>unaltered</strong>(value) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value unaltered.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#underscore-class_method" title="underscore (class method)">+ (Object) <strong>underscore</strong>(value) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Transforms values to underscore_case.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="camel-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>camel</strong>(value)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Transforms values to UpperCamelCase or PascalCase.</p>
|
||||
|
||||
<p>@example:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">"some_key" => "SomeKey",</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
<p class="tag_title">See Also:</p>
|
||||
<ul class="see">
|
||||
|
||||
<li><a href="{https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflector/methods.rb#L66-L76" target="_parent" title="ActiveSupport::Inflector.camelize}">ActiveSupport::Inflector.camelize}</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/key_transform.rb', line 12</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_camel'>camel</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
||||
<span class='kw'>case</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>when</span> <span class='const'>Hash</span> <span class='kw'>then</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_deep_transform_keys!'>deep_transform_keys!</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <span class='id identifier rubyid_camel'>camel</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
||||
<span class='kw'>when</span> <span class='const'>Symbol</span> <span class='kw'>then</span> <span class='id identifier rubyid_camel'>camel</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
||||
<span class='kw'>when</span> <span class='const'>String</span> <span class='kw'>then</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='period'>.</span><span class='id identifier rubyid_camelize'>camelize</span>
|
||||
<span class='kw'>else</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="camel_lower-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>camel_lower</strong>(value)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Transforms values to camelCase.</p>
|
||||
|
||||
<p>@example:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">"some_key" => "someKey",</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
<p class="tag_title">See Also:</p>
|
||||
<ul class="see">
|
||||
|
||||
<li><a href="{https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflector/methods.rb#L66-L76" target="_parent" title="ActiveSupport::Inflector.camelize}">ActiveSupport::Inflector.camelize}</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
26
|
||||
27
|
||||
28
|
||||
29
|
||||
30
|
||||
31
|
||||
32
|
||||
33</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/key_transform.rb', line 26</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_camel_lower'>camel_lower</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
||||
<span class='kw'>case</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>when</span> <span class='const'>Hash</span> <span class='kw'>then</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_deep_transform_keys!'>deep_transform_keys!</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <span class='id identifier rubyid_camel_lower'>camel_lower</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
||||
<span class='kw'>when</span> <span class='const'>Symbol</span> <span class='kw'>then</span> <span class='id identifier rubyid_camel_lower'>camel_lower</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
||||
<span class='kw'>when</span> <span class='const'>String</span> <span class='kw'>then</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='period'>.</span><span class='id identifier rubyid_camelize'>camelize</span><span class='lparen'>(</span><span class='symbol'>:lower</span><span class='rparen'>)</span>
|
||||
<span class='kw'>else</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="dash-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>dash</strong>(value)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Transforms values to dashed-case. This is the default case for the JsonApi
|
||||
adapter.</p>
|
||||
|
||||
<p>@example:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">"some_key" => "some-key",</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
<p class="tag_title">See Also:</p>
|
||||
<ul class="see">
|
||||
|
||||
<li><a href="{https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflector/methods.rb#L185-L187" target="_parent" title="ActiveSupport::Inflector.dasherize}">ActiveSupport::Inflector.dasherize}</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
41
|
||||
42
|
||||
43
|
||||
44
|
||||
45
|
||||
46
|
||||
47
|
||||
48</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/key_transform.rb', line 41</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_dash'>dash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
||||
<span class='kw'>case</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>when</span> <span class='const'>Hash</span> <span class='kw'>then</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_deep_transform_keys!'>deep_transform_keys!</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <span class='id identifier rubyid_dash'>dash</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
||||
<span class='kw'>when</span> <span class='const'>Symbol</span> <span class='kw'>then</span> <span class='id identifier rubyid_dash'>dash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
||||
<span class='kw'>when</span> <span class='const'>String</span> <span class='kw'>then</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='period'>.</span><span class='id identifier rubyid_dasherize'>dasherize</span>
|
||||
<span class='kw'>else</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="unaltered-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>unaltered</strong>(value)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value unaltered</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
66
|
||||
67
|
||||
68</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/key_transform.rb', line 66</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_unaltered'>unaltered</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="underscore-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>underscore</strong>(value)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Transforms values to underscore_case. This is the default case for
|
||||
deserialization in the JsonApi adapter.</p>
|
||||
|
||||
<p>@example:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">"some-key" => "some_key",</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
<p class="tag_title">See Also:</p>
|
||||
<ul class="see">
|
||||
|
||||
<li><a href="{https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflector/methods.rb#L89-L98" target="_parent" title="ActiveSupport::Inflector.underscore}">ActiveSupport::Inflector.underscore}</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
56
|
||||
57
|
||||
58
|
||||
59
|
||||
60
|
||||
61
|
||||
62
|
||||
63</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/key_transform.rb', line 56</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_underscore'>underscore</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
||||
<span class='kw'>case</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>when</span> <span class='const'>Hash</span> <span class='kw'>then</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_deep_transform_keys!'>deep_transform_keys!</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <span class='id identifier rubyid_underscore'>underscore</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
||||
<span class='kw'>when</span> <span class='const'>Symbol</span> <span class='kw'>then</span> <span class='id identifier rubyid_underscore'>underscore</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
||||
<span class='kw'>when</span> <span class='const'>String</span> <span class='kw'>then</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span>
|
||||
<span class='kw'>else</span> <span class='id identifier rubyid_value'>value</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,271 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Logging
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/Logging.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (L)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">Logging</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Logging
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Concern</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Included in:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="SerializableResource.html" title="ActiveModelSerializers::SerializableResource (class)">SerializableResource</a></span></dd>
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/logging.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Logging/ClassMethods.html" title="ActiveModelSerializers::Logging::ClassMethods (module)">ClassMethods</a></span>, <span class='object_link'><a href="Logging/Macros.html" title="ActiveModelSerializers::Logging::Macros (module)">Macros</a></span>
|
||||
|
||||
|
||||
|
||||
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Logging/LogSubscriber.html" title="ActiveModelSerializers::Logging::LogSubscriber (class)">LogSubscriber</a></span>
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<dl class="constants">
|
||||
|
||||
<dt id="RENDER_EVENT-constant" class="">RENDER_EVENT =
|
||||
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>render.active_model_serializers</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#notify_render-instance_method" title="#notify_render (instance method)">- (Object) <strong>notify_render</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#notify_render_payload-instance_method" title="#notify_render_payload (instance method)">- (Object) <strong>notify_render_payload</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="notify_render-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>notify_render</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
76
|
||||
77
|
||||
78
|
||||
79
|
||||
80
|
||||
81</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/logging.rb', line 76</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_notify_render'>notify_render</span><span class='lparen'>(</span><span class='op'>*</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_event_name'>event_name</span> <span class='op'>=</span> <span class='const'>RENDER_EVENT</span>
|
||||
<span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>Notifications</span><span class='period'>.</span><span class='id identifier rubyid_instrument'>instrument</span><span class='lparen'>(</span><span class='id identifier rubyid_event_name'>event_name</span><span class='comma'>,</span> <span class='id identifier rubyid_notify_render_payload'>notify_render_payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
||||
<span class='kw'>yield</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="notify_render_payload-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>notify_render_payload</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
83
|
||||
84
|
||||
85
|
||||
86
|
||||
87
|
||||
88</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/logging.rb', line 83</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_notify_render_payload'>notify_render_payload</span>
|
||||
<span class='lbrace'>{</span>
|
||||
<span class='label'>serializer:</span> <span class='id identifier rubyid_serializer'>serializer</span> <span class='op'>||</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span><span class='op'>::</span><span class='const'>Null</span><span class='comma'>,</span>
|
||||
<span class='label'>adapter:</span> <span class='id identifier rubyid_adapter'>adapter</span> <span class='op'>||</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Adapter</span><span class='op'>::</span><span class='const'>Null</span>
|
||||
<span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,186 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Logging::ClassMethods
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModelSerializers/Logging/ClassMethods.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (C)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../Logging.html" title="ActiveModelSerializers::Logging (module)">Logging</a></span></span>
|
||||
»
|
||||
<span class="title">ClassMethods</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Logging::ClassMethods
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/logging.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#instrument_rendering-instance_method" title="#instrument_rendering (instance method)">- (Object) <strong>instrument_rendering</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="instrument_rendering-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>instrument_rendering</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/logging.rb', line 18</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_instrument_rendering'>instrument_rendering</span>
|
||||
<span class='id identifier rubyid_around_render'>around_render</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_tag_logger'>tag_logger</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_notify_render'>notify_render</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,254 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Logging::LogSubscriber
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModelSerializers/Logging/LogSubscriber.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (L)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../Logging.html" title="ActiveModelSerializers::Logging (module)">Logging</a></span></span>
|
||||
»
|
||||
<span class="title">LogSubscriber</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Logging::LogSubscriber
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">ActiveSupport::LogSubscriber</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveSupport::LogSubscriber</li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Logging::LogSubscriber</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/logging.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#logger-instance_method" title="#logger (instance method)">- (Object) <strong>logger</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#render-instance_method" title="#render (instance method)">- (Object) <strong>render</strong>(event) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="logger-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>logger</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
115
|
||||
116
|
||||
117</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/logging.rb', line 115</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_logger'>logger</span>
|
||||
<span class='const'>ActiveModelSerializers</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="render-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>render</strong>(event)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
106
|
||||
107
|
||||
108
|
||||
109
|
||||
110
|
||||
111
|
||||
112
|
||||
113</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/logging.rb', line 106</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_info'>info</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span> <span class='op'>=</span> <span class='id identifier rubyid_event'>event</span><span class='period'>.</span><span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:serializer</span><span class='rbracket'>]</span>
|
||||
<span class='id identifier rubyid_adapter'>adapter</span> <span class='op'>=</span> <span class='id identifier rubyid_event'>event</span><span class='period'>.</span><span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:adapter</span><span class='rbracket'>]</span>
|
||||
<span class='id identifier rubyid_duration'>duration</span> <span class='op'>=</span> <span class='id identifier rubyid_event'>event</span><span class='period'>.</span><span class='id identifier rubyid_duration'>duration</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span>
|
||||
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Rendered </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> with </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_content'> (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_duration'>duration</span><span class='embexpr_end'>}</span><span class='tstring_content'>ms)</span><span class='tstring_end'>"</span></span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:38 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,249 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Logging::Macros
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModelSerializers/Logging/Macros.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (M)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../Logging.html" title="ActiveModelSerializers::Logging (module)">Logging</a></span></span>
|
||||
»
|
||||
<span class="title">Macros</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Logging::Macros
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/logging.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Macros that can be used to customize the logging of class or instance
|
||||
methods, by extending the class or its singleton.</p>
|
||||
|
||||
<p>Adapted from:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_https'>https</span><span class='symbol'>:/</span><span class='op'>/</span><span class='id identifier rubyid_github'>github</span><span class='period'>.</span><span class='id identifier rubyid_com'>com</span><span class='op'>/</span><span class='id identifier rubyid_rubygems'>rubygems</span><span class='op'>/</span><span class='id identifier rubyid_rubygems'>rubygems</span><span class='op'>/</span><span class='id identifier rubyid_blob'>blob</span><span class='op'>/</span><span class='id identifier rubyid_cb28f5e991'>cb28f5e991</span><span class='op'>/</span><span class='id identifier rubyid_lib'>lib</span><span class='op'>/</span><span class='id identifier rubyid_rubygems'>rubygems</span><span class='op'>/</span><span class='id identifier rubyid_deprecate'>deprecate</span><span class='period'>.</span><span class='id identifier rubyid_rb'>rb</span>
|
||||
</code></pre>
|
||||
|
||||
<p>Provides a single method <code>notify</code> to be used to declare when
|
||||
something a method notifies, with the argument <code>callback_name</code>
|
||||
of the notification callback.</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>Adapter</span>
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_klass_method'>klass_method</span>
|
||||
<span class='comment'># ...
|
||||
</span> <span class='kw'>end</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_instance_method'>instance_method</span>
|
||||
<span class='comment'># ...
|
||||
</span> <span class='kw'>end</span>
|
||||
|
||||
<span class='id identifier rubyid_include'>include</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Logging</span><span class='op'>::</span><span class='const'>Macros</span>
|
||||
<span class='id identifier rubyid_notify'>notify</span> <span class='symbol'>:instance_method</span><span class='comma'>,</span> <span class='symbol'>:render</span>
|
||||
|
||||
<span class='kw'>class</span> <span class='op'><<</span> <span class='kw'>self</span>
|
||||
<span class='id identifier rubyid_extend'>extend</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Logging</span><span class='op'>::</span><span class='const'>Macros</span>
|
||||
<span class='id identifier rubyid_notify'>notify</span> <span class='symbol'>:klass_method</span><span class='comma'>,</span> <span class='symbol'>:render</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span>
|
||||
</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#notify-instance_method" title="#notify (instance method)">- (Object) <strong>notify</strong>(name, callback_name) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Simple notify method that wraps up <code>name</code> in a dummy method.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="notify-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>notify</strong>(name, callback_name)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Simple notify method that wraps up <code>name</code> in a dummy method. It
|
||||
notifies on with the <code>callback_name</code> notifier on each call to
|
||||
the dummy method, telling what the current serializer and adapter are being
|
||||
rendered. Adapted from:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_https'>https</span><span class='symbol'>:/</span><span class='op'>/</span><span class='id identifier rubyid_github'>github</span><span class='period'>.</span><span class='id identifier rubyid_com'>com</span><span class='op'>/</span><span class='id identifier rubyid_rubygems'>rubygems</span><span class='op'>/</span><span class='id identifier rubyid_rubygems'>rubygems</span><span class='op'>/</span><span class='id identifier rubyid_blob'>blob</span><span class='op'>/</span><span class='id identifier rubyid_cb28f5e991'>cb28f5e991</span><span class='op'>/</span><span class='id identifier rubyid_lib'>lib</span><span class='op'>/</span><span class='id identifier rubyid_rubygems'>rubygems</span><span class='op'>/</span><span class='id identifier rubyid_deprecate'>deprecate</span><span class='period'>.</span><span class='id identifier rubyid_rb'>rb</span>
|
||||
</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
63
|
||||
64
|
||||
65
|
||||
66
|
||||
67
|
||||
68
|
||||
69
|
||||
70
|
||||
71
|
||||
72
|
||||
73</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/logging.rb', line 63</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_notify'>notify</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_callback_name'>callback_name</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_class_eval'>class_eval</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_old'>old</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>_notifying_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_callback_name'>callback_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
||||
<span class='id identifier rubyid_alias_method'>alias_method</span> <span class='id identifier rubyid_old'>old</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span>
|
||||
<span class='id identifier rubyid_define_method'>define_method</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>do</span> <span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_run_callbacks'>run_callbacks</span> <span class='id identifier rubyid_callback_name'>callback_name</span> <span class='kw'>do</span>
|
||||
<span class='id identifier rubyid_send'>send</span> <span class='id identifier rubyid_old'>old</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,761 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Model
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/Model.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (M)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">Model</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Model
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Model</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Includes:</dt>
|
||||
<dd class="r2">ActiveModel::Model, ActiveModel::Serializers::JSON</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/model.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#attributes-instance_method" title="#attributes (instance method)">- (Object) <strong>attributes</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute attributes.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#errors-instance_method" title="#errors (instance method)">- (Object) <strong>errors</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute errors.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#human_attribute_name-class_method" title="human_attribute_name (class method)">+ (Object) <strong>human_attribute_name</strong>(attr, _options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>The following methods are needed to be minimally implemented for
|
||||
ActiveModel::Errors :nocov:.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#lookup_ancestors-class_method" title="lookup_ancestors (class method)">+ (Object) <strong>lookup_ancestors</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#cache_key-instance_method" title="#cache_key (instance method)">- (Object) <strong>cache_key</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Defaults to the downcased model name and updated_at.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#id-instance_method" title="#id (instance method)">- (Object) <strong>id</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Defaults to the downcased model name.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Model) <strong>initialize</strong>(attributes = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of Model.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#read_attribute_for_serialization-instance_method" title="#read_attribute_for_serialization (instance method)">- (Object) <strong>read_attribute_for_serialization</strong>(key) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#updated_at-instance_method" title="#updated_at (instance method)">- (Object) <strong>updated_at</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Defaults to the time the serializer file was modified.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Model (class)">Model</a></span></tt>) <strong>initialize</strong>(attributes = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of Model</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/model.rb', line 11</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@attributes</span> <span class='op'>=</span> <span class='id identifier rubyid_attributes'>attributes</span>
|
||||
<span class='ivar'>@errors</span> <span class='op'>=</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Errors</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="instance_attr_details" class="attr_details">
|
||||
<h2>Instance Attribute Details</h2>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="attributes-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>attributes</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute attributes</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
9
|
||||
10
|
||||
11</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/model.rb', line 9</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_attributes'>attributes</span>
|
||||
<span class='ivar'>@attributes</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="errors-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>errors</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute errors</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
9
|
||||
10
|
||||
11</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/model.rb', line 9</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_errors'>errors</span>
|
||||
<span class='ivar'>@errors</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="human_attribute_name-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>human_attribute_name</strong>(attr, _options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>The following methods are needed to be minimally implemented for
|
||||
ActiveModel::Errors :nocov:</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
42
|
||||
43
|
||||
44</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/model.rb', line 42</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_human_attribute_name'>human_attribute_name</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='comma'>,</span> <span class='id identifier rubyid__options'>_options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_attr'>attr</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="lookup_ancestors-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>lookup_ancestors</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
46
|
||||
47
|
||||
48</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/model.rb', line 46</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_lookup_ancestors'>lookup_ancestors</span>
|
||||
<span class='lbracket'>[</span><span class='kw'>self</span><span class='rbracket'>]</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="cache_key-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>cache_key</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Defaults to the downcased model name and updated_at</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
23
|
||||
24
|
||||
25</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/model.rb', line 23</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_cache_key'>cache_key</span>
|
||||
<span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:cache_key</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>-</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_updated_at'>updated_at</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%Y%m%d%H%M%S%9N</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="id-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>id</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Defaults to the downcased model name.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
18
|
||||
19
|
||||
20</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/model.rb', line 18</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span>
|
||||
<span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:id</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="read_attribute_for_serialization-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>read_attribute_for_serialization</strong>(key)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37
|
||||
38</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/model.rb', line 32</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_read_attribute_for_serialization'>read_attribute_for_serialization</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
||||
<span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>==</span> <span class='symbol'>:id</span> <span class='op'>||</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id</span><span class='tstring_end'>'</span></span>
|
||||
<span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
|
||||
<span class='kw'>else</span>
|
||||
<span class='id identifier rubyid_attributes'>attributes</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="updated_at-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>updated_at</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Defaults to the time the serializer file was modified.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
28
|
||||
29
|
||||
30</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/model.rb', line 28</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_updated_at'>updated_at</span>
|
||||
<span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:updated_at</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_mtime'>mtime</span><span class='lparen'>(</span><span class='kw'>__FILE__</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:38 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,123 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Railtie
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/Railtie.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (R)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">Railtie</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Railtie
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Rails::Railtie</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">Rails::Railtie</li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Railtie</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/railtie.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:38 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,831 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::SerializableResource
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/SerializableResource.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (S)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">SerializableResource</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::SerializableResource
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::SerializableResource</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2">Includes:</dt>
|
||||
<dd class="r2"><span class='object_link'><a href="Logging.html" title="ActiveModelSerializers::Logging (module)">Logging</a></span></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/serializable_resource.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<dl class="constants">
|
||||
|
||||
<dt id="ADAPTER_OPTION_KEYS-constant" class="">ADAPTER_OPTION_KEYS =
|
||||
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='symbol'>:include</span><span class='comma'>,</span> <span class='symbol'>:fields</span><span class='comma'>,</span> <span class='symbol'>:adapter</span><span class='comma'>,</span> <span class='symbol'>:meta</span><span class='comma'>,</span> <span class='symbol'>:meta_key</span><span class='comma'>,</span> <span class='symbol'>:links</span><span class='comma'>,</span> <span class='symbol'>:serialization_context</span><span class='comma'>,</span> <span class='symbol'>:key_transform</span><span class='rbracket'>]</span><span class='rparen'>)</span></pre></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Constants included
|
||||
from <span class='object_link'><a href="Logging.html" title="ActiveModelSerializers::Logging (module)">Logging</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Logging.html#RENDER_EVENT-constant" title="ActiveModelSerializers::Logging::RENDER_EVENT (constant)">Logging::RENDER_EVENT</a></span></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#adapter-instance_method" title="#adapter (instance method)">- (Object) <strong>adapter</strong> </a>
|
||||
|
||||
|
||||
|
||||
(also: #adapter_instance)
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>NOTE: if no adapter is available, returns the resource itself.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#find_adapter-instance_method" title="#find_adapter (instance method)">- (Object) <strong>find_adapter</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Object) <strong>initialize</strong>(resource, options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Primary interface to composing a resource with a serializer and adapter.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serialization_scope-instance_method" title="#serialization_scope (instance method)">- (Object) <strong>serialization_scope</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serialization_scope%3D-instance_method" title="#serialization_scope= (instance method)">- (Object) <strong>serialization_scope=</strong>(scope) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serialization_scope_name%3D-instance_method" title="#serialization_scope_name= (instance method)">- (Object) <strong>serialization_scope_name=</strong>(scope_name) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serializer-instance_method" title="#serializer (instance method)">- (Object) <strong>serializer</strong> </a>
|
||||
|
||||
|
||||
|
||||
(also: #serializer_class)
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Get serializer either explicitly :serializer or implicitly from resource
|
||||
Remove :serializer key from serializer_opts Replace :serializer key with
|
||||
:each_serializer if present.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serializer%3F-instance_method" title="#serializer? (instance method)">- (Boolean) <strong>serializer?</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serializer_instance-instance_method" title="#serializer_instance (instance method)">- (Object) <strong>serializer_instance</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#use_adapter%3F-instance_method" title="#use_adapter? (instance method)">- (Boolean) <strong>use_adapter?</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>True when no explicit adapter given, or explicit appear is truthy (non-nil)
|
||||
False when explicit adapter is falsy (nil or false).</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods included from <span class='object_link'><a href="Logging.html" title="ActiveModelSerializers::Logging (module)">Logging</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="Logging.html#notify_render-instance_method" title="ActiveModelSerializers::Logging#notify_render (method)">#notify_render</a></span>, <span class='object_link'><a href="Logging.html#notify_render_payload-instance_method" title="ActiveModelSerializers::Logging#notify_render_payload (method)">#notify_render_payload</a></span></p>
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>initialize</strong>(resource, options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Primary interface to composing a resource with a serializer and adapter.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serializable_resource.rb', line 15</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@resource</span> <span class='op'>=</span> <span class='id identifier rubyid_resource'>resource</span>
|
||||
<span class='ivar'>@adapter_opts</span><span class='comma'>,</span> <span class='ivar'>@serializer_opts</span> <span class='op'>=</span>
|
||||
<span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_partition'>partition</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid__'>_</span><span class='op'>|</span> <span class='const'>ADAPTER_OPTION_KEYS</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_k'>k</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='op'>|</span> <span class='const'>Hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_h'>h</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="adapter-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>adapter</strong>
|
||||
|
||||
|
||||
|
||||
<span class="aliases">Also known as:
|
||||
<span class="names"><span id='adapter_instance-instance_method'>adapter_instance</span></span>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>NOTE: if no adapter is available, returns the resource itself. (i.e.
|
||||
adapter is a no-op)</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
34
|
||||
35
|
||||
36</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serializable_resource.rb', line 34</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_adapter'>adapter</span>
|
||||
<span class='ivar'>@adapter</span> <span class='op'>||=</span> <span class='id identifier rubyid_find_adapter'>find_adapter</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="find_adapter-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>find_adapter</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
39
|
||||
40
|
||||
41
|
||||
42
|
||||
43
|
||||
44</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serializable_resource.rb', line 39</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_find_adapter'>find_adapter</span>
|
||||
<span class='kw'>return</span> <span class='id identifier rubyid_resource'>resource</span> <span class='kw'>unless</span> <span class='id identifier rubyid_serializer?'>serializer?</span>
|
||||
<span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer_instance'>serializer_instance</span><span class='comma'>,</span> <span class='id identifier rubyid_adapter_opts'>adapter_opts</span><span class='rparen'>)</span>
|
||||
<span class='kw'>rescue</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span><span class='op'>::</span><span class='const'>CollectionSerializer</span><span class='op'>::</span><span class='const'>NoSerializerError</span>
|
||||
<span class='id identifier rubyid_resource'>resource</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serialization_scope-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serialization_scope</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
25
|
||||
26
|
||||
27</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serializable_resource.rb', line 25</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serialization_scope'>serialization_scope</span>
|
||||
<span class='id identifier rubyid_serializer_opts'>serializer_opts</span><span class='lbracket'>[</span><span class='symbol'>:scope</span><span class='rbracket'>]</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serialization_scope=-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serialization_scope=</strong>(scope)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
21
|
||||
22
|
||||
23</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serializable_resource.rb', line 21</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serialization_scope='>serialization_scope=</span><span class='lparen'>(</span><span class='id identifier rubyid_scope'>scope</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serializer_opts'>serializer_opts</span><span class='lbracket'>[</span><span class='symbol'>:scope</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_scope'>scope</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serialization_scope_name=-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serialization_scope_name=</strong>(scope_name)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
29
|
||||
30
|
||||
31</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serializable_resource.rb', line 29</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serialization_scope_name='>serialization_scope_name=</span><span class='lparen'>(</span><span class='id identifier rubyid_scope_name'>scope_name</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serializer_opts'>serializer_opts</span><span class='lbracket'>[</span><span class='symbol'>:scope_name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_scope_name'>scope_name</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serializer-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serializer</strong>
|
||||
|
||||
|
||||
|
||||
<span class="aliases">Also known as:
|
||||
<span class="names"><span id='serializer_class-instance_method'>serializer_class</span></span>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Get serializer either explicitly :serializer or implicitly from resource
|
||||
Remove :serializer key from serializer_opts Replace :serializer key with
|
||||
:each_serializer if present</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
53
|
||||
54
|
||||
55
|
||||
56
|
||||
57
|
||||
58
|
||||
59
|
||||
60
|
||||
61
|
||||
62
|
||||
63
|
||||
64</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serializable_resource.rb', line 53</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serializer'>serializer</span>
|
||||
<span class='ivar'>@serializer</span> <span class='op'>||=</span>
|
||||
<span class='kw'>begin</span>
|
||||
<span class='ivar'>@serializer</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer_opts'>serializer_opts</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:serializer</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@serializer</span> <span class='op'>||=</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span><span class='period'>.</span><span class='id identifier rubyid_serializer_for'>serializer_for</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='rparen'>)</span>
|
||||
|
||||
<span class='kw'>if</span> <span class='id identifier rubyid_serializer_opts'>serializer_opts</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:each_serializer</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serializer_opts'>serializer_opts</span><span class='lbracket'>[</span><span class='symbol'>:serializer</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_serializer_opts'>serializer_opts</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:each_serializer</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='ivar'>@serializer</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serializer?-instance_method">
|
||||
|
||||
- (<tt>Boolean</tt>) <strong>serializer?</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
73
|
||||
74
|
||||
75</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serializable_resource.rb', line 73</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serializer?'>serializer?</span>
|
||||
<span class='id identifier rubyid_use_adapter?'>use_adapter?</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serializer_instance-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serializer_instance</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
46
|
||||
47
|
||||
48</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serializable_resource.rb', line 46</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serializer_instance'>serializer_instance</span>
|
||||
<span class='ivar'>@serializer_instance</span> <span class='op'>||=</span> <span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_serializer_opts'>serializer_opts</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="use_adapter?-instance_method">
|
||||
|
||||
- (<tt>Boolean</tt>) <strong>use_adapter?</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>True when no explicit adapter given, or explicit appear is truthy (non-nil)
|
||||
False when explicit adapter is falsy (nil or false)</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
69
|
||||
70
|
||||
71</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serializable_resource.rb', line 69</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_use_adapter?'>use_adapter?</span>
|
||||
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_opts'>adapter_opts</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:adapter</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_adapter_opts'>adapter_opts</span><span class='lbracket'>[</span><span class='symbol'>:adapter</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,568 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::SerializationContext
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/SerializationContext.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (S)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">SerializationContext</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::SerializationContext
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::SerializationContext</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/serialization_context.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="SerializationContext/UrlHelpers.html" title="ActiveModelSerializers::SerializationContext::UrlHelpers (module)">UrlHelpers</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Class Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#default_url_options-class_method" title="default_url_options (class method)">+ (Object) <strong>default_url_options</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#url_helpers-class_method" title="url_helpers (class method)">+ (Object) <strong>url_helpers</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#key_transform-instance_method" title="#key_transform (instance method)">- (Object) <strong>key_transform</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute key_transform.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#query_parameters-instance_method" title="#query_parameters (instance method)">- (Object) <strong>query_parameters</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute query_parameters.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#request_url-instance_method" title="#request_url (instance method)">- (Object) <strong>request_url</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute request_url.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (SerializationContext) <strong>initialize</strong>(request, options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of SerializationContext.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::SerializationContext (class)">SerializationContext</a></span></tt>) <strong>initialize</strong>(request, options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of SerializationContext</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
25
|
||||
26
|
||||
27
|
||||
28
|
||||
29
|
||||
30</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serialization_context.rb', line 25</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@request_url</span> <span class='op'>=</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_original_url'>original_url</span><span class='lbracket'>[</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A[^?]+</span><span class='regexp_end'>/</span></span><span class='rbracket'>]</span>
|
||||
<span class='ivar'>@query_parameters</span> <span class='op'>=</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_query_parameters'>query_parameters</span>
|
||||
<span class='ivar'>@url_helpers</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:url_helpers</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_url_helpers'>url_helpers</span>
|
||||
<span class='ivar'>@default_url_options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:default_url_options</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_default_url_options'>default_url_options</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="class_attr_details" class="attr_details">
|
||||
<h2>Class Attribute Details</h2>
|
||||
|
||||
|
||||
<span id="default_url_options=-class_method"></span>
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="default_url_options-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>default_url_options</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
9
|
||||
10
|
||||
11</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serialization_context.rb', line 9</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_default_url_options'>default_url_options</span>
|
||||
<span class='ivar'>@default_url_options</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id="url_helpers=-class_method"></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="url_helpers-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>url_helpers</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
5
|
||||
6
|
||||
7</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serialization_context.rb', line 5</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_url_helpers'>url_helpers</span>
|
||||
<span class='ivar'>@url_helpers</span> <span class='op'>||=</span> <span class='const'>Module</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="instance_attr_details" class="attr_details">
|
||||
<h2>Instance Attribute Details</h2>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="key_transform-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>key_transform</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute key_transform</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
23
|
||||
24
|
||||
25</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serialization_context.rb', line 23</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_key_transform'>key_transform</span>
|
||||
<span class='ivar'>@key_transform</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="query_parameters-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>query_parameters</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute query_parameters</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
23
|
||||
24
|
||||
25</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serialization_context.rb', line 23</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_query_parameters'>query_parameters</span>
|
||||
<span class='ivar'>@query_parameters</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="request_url-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>request_url</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute request_url</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
23
|
||||
24
|
||||
25</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serialization_context.rb', line 23</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_request_url'>request_url</span>
|
||||
<span class='ivar'>@request_url</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:40 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,245 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::SerializationContext::UrlHelpers
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModelSerializers/SerializationContext/UrlHelpers.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (U)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../SerializationContext.html" title="ActiveModelSerializers::SerializationContext (class)">SerializationContext</a></span></span>
|
||||
»
|
||||
<span class="title">UrlHelpers</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::SerializationContext::UrlHelpers
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Included in:</dt>
|
||||
<dd class="r1"><span class='object_link'><a href="../Adapter/JsonApi/Link.html" title="ActiveModelSerializers::Adapter::JsonApi::Link (class)">Adapter::JsonApi::Link</a></span></dd>
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/serialization_context.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#included-class_method" title="included (class method)">+ (Object) <strong>included</strong>(base) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#default_url_options-instance_method" title="#default_url_options (instance method)">- (Object) <strong>default_url_options</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="included-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>included</strong>(base)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
14
|
||||
15
|
||||
16</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serialization_context.rb', line 14</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:include</span><span class='comma'>,</span> <span class='const'>SerializationContext</span><span class='period'>.</span><span class='id identifier rubyid_url_helpers'>url_helpers</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="default_url_options-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>default_url_options</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
18
|
||||
19
|
||||
20</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/serialization_context.rb', line 18</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_default_url_options'>default_url_options</span>
|
||||
<span class='const'>SerializationContext</span><span class='period'>.</span><span class='id identifier rubyid_default_url_options'>default_url_options</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,122 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Test
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!ActiveModelSerializers/Test.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (T)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span>
|
||||
»
|
||||
<span class="title">Test</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Test
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Autoload</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/test.rb<span class="defines">,<br />
|
||||
lib/active_model_serializers/test/schema.rb,<br /> lib/active_model_serializers/test/serializer.rb</span>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Test/Schema.html" title="ActiveModelSerializers::Test::Schema (module)">Schema</a></span>, <span class='object_link'><a href="Test/Serializer.html" title="ActiveModelSerializers::Test::Serializer (module)">Serializer</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,472 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Test::Schema
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModelSerializers/Test/Schema.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (S)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../Test.html" title="ActiveModelSerializers::Test (module)">Test</a></span></span>
|
||||
»
|
||||
<span class="title">Schema</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Test::Schema
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/active_model_serializers/test/schema.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
|
||||
|
||||
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Schema/AssertRequestSchema.html" title="ActiveModelSerializers::Test::Schema::AssertRequestSchema (class)">AssertRequestSchema</a></span>, <span class='object_link'><a href="Schema/AssertResponseSchema.html" title="ActiveModelSerializers::Test::Schema::AssertResponseSchema (class)">AssertResponseSchema</a></span>, <span class='object_link'><a href="Schema/AssertSchema.html" title="ActiveModelSerializers::Test::Schema::AssertSchema (class)">AssertSchema</a></span>
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<dl class="constants">
|
||||
|
||||
<dt id="MissingSchema-constant" class="">MissingSchema =
|
||||
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>Minitest</span><span class='op'>::</span><span class='const'>Assertion</span><span class='rparen'>)</span></pre></dd>
|
||||
|
||||
<dt id="InvalidSchemaError-constant" class="">InvalidSchemaError =
|
||||
|
||||
</dt>
|
||||
<dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>Minitest</span><span class='op'>::</span><span class='const'>Assertion</span><span class='rparen'>)</span></pre></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#assert_request_response_schema-instance_method" title="#assert_request_response_schema (instance method)">- (Object) <strong>assert_request_response_schema</strong>(schema_path = nil, message = nil) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>May be renamed.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#assert_request_schema-instance_method" title="#assert_request_schema (instance method)">- (Object) <strong>assert_request_schema</strong>(schema_path = nil, message = nil) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#assert_response_schema-instance_method" title="#assert_response_schema (instance method)">- (Boolean, Minitest::Assertion) <strong>assert_response_schema</strong>(schema_path = nil, message = nil) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A Minitest Assertion that test the response is valid against a schema.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#assert_schema-instance_method" title="#assert_schema (instance method)">- (Object) <strong>assert_schema</strong>(payload, schema_path = nil, message = nil) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="assert_request_response_schema-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>assert_request_response_schema</strong>(schema_path = nil, message = nil)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>May be renamed</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
23
|
||||
24
|
||||
25
|
||||
26</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 23</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_assert_request_response_schema'>assert_request_response_schema</span><span class='lparen'>(</span><span class='id identifier rubyid_schema_path'>schema_path</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_assert_request_schema'>assert_request_schema</span><span class='lparen'>(</span><span class='id identifier rubyid_schema_path'>schema_path</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_assert_response_schema'>assert_response_schema</span><span class='lparen'>(</span><span class='id identifier rubyid_schema_path'>schema_path</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="assert_request_schema-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>assert_request_schema</strong>(schema_path = nil, message = nil)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
17
|
||||
18
|
||||
19
|
||||
20</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 17</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_assert_request_schema'>assert_request_schema</span><span class='lparen'>(</span><span class='id identifier rubyid_schema_path'>schema_path</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_matcher'>matcher</span> <span class='op'>=</span> <span class='const'>AssertRequestSchema</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_schema_path'>schema_path</span><span class='comma'>,</span> <span class='id identifier rubyid_request'>request</span><span class='comma'>,</span> <span class='id identifier rubyid_response'>response</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_assert'>assert</span><span class='lparen'>(</span><span class='id identifier rubyid_matcher'>matcher</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='comma'>,</span> <span class='id identifier rubyid_matcher'>matcher</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="assert_response_schema-instance_method">
|
||||
|
||||
- (<tt>Boolean</tt>, <tt>Minitest::Assertion</tt>) <strong>assert_response_schema</strong>(schema_path = nil, message = nil)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>A Minitest Assertion that test the response is valid against a schema.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<div class="examples">
|
||||
<p class="tag_title">Examples:</p>
|
||||
|
||||
|
||||
<pre class="example code"><code><span class='id identifier rubyid_get'>get</span> <span class='symbol'>:index</span>
|
||||
<span class='id identifier rubyid_assert_response_schema'>assert_response_schema</span></code></pre>
|
||||
|
||||
</div>
|
||||
<p class="tag_title">Parameters:</p>
|
||||
<ul class="param">
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>schema_path</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>a custom schema path</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>message</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>a custom error message</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>true when the response is valid</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Minitest::Assertion</tt>)</span>
|
||||
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>when the response is invalid</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
12
|
||||
13
|
||||
14
|
||||
15</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 12</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_assert_response_schema'>assert_response_schema</span><span class='lparen'>(</span><span class='id identifier rubyid_schema_path'>schema_path</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_matcher'>matcher</span> <span class='op'>=</span> <span class='const'>AssertResponseSchema</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_schema_path'>schema_path</span><span class='comma'>,</span> <span class='id identifier rubyid_request'>request</span><span class='comma'>,</span> <span class='id identifier rubyid_response'>response</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_assert'>assert</span><span class='lparen'>(</span><span class='id identifier rubyid_matcher'>matcher</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='comma'>,</span> <span class='id identifier rubyid_matcher'>matcher</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="assert_schema-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>assert_schema</strong>(payload, schema_path = nil, message = nil)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
28
|
||||
29
|
||||
30
|
||||
31</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 28</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_assert_schema'>assert_schema</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span> <span class='id identifier rubyid_schema_path'>schema_path</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_matcher'>matcher</span> <span class='op'>=</span> <span class='const'>AssertSchema</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_schema_path'>schema_path</span><span class='comma'>,</span> <span class='id identifier rubyid_request'>request</span><span class='comma'>,</span> <span class='id identifier rubyid_response'>response</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_assert'>assert</span><span class='lparen'>(</span><span class='id identifier rubyid_matcher'>matcher</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='comma'>,</span> <span class='id identifier rubyid_matcher'>matcher</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,222 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Test::Schema::AssertRequestSchema
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModelSerializers/Test/Schema/AssertRequestSchema.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../../Test.html" title="ActiveModelSerializers::Test (module)">Test</a></span></span> » <span class='title'><span class='object_link'><a href="../Schema.html" title="ActiveModelSerializers::Test::Schema (module)">Schema</a></span></span>
|
||||
»
|
||||
<span class="title">AssertRequestSchema</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Test::Schema::AssertRequestSchema
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="AssertSchema.html" title="ActiveModelSerializers::Test::Schema::AssertSchema (class)">AssertSchema</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="AssertSchema.html" title="ActiveModelSerializers::Test::Schema::AssertSchema (class)">AssertSchema</a></span></li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Test::Schema::AssertRequestSchema</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/test/schema.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="AssertSchema.html" title="ActiveModelSerializers::Test::Schema::AssertSchema (class)">AssertSchema</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="AssertSchema.html#message-instance_method" title="ActiveModelSerializers::Test::Schema::AssertSchema#message (method)">#message</a></span>, <span class='object_link'><a href="AssertSchema.html#payload-instance_method" title="ActiveModelSerializers::Test::Schema::AssertSchema#payload (method)">#payload</a></span>, <span class='object_link'><a href="AssertSchema.html#request-instance_method" title="ActiveModelSerializers::Test::Schema::AssertSchema#request (method)">#request</a></span>, <span class='object_link'><a href="AssertSchema.html#response-instance_method" title="ActiveModelSerializers::Test::Schema::AssertSchema#response (method)">#response</a></span>, <span class='object_link'><a href="AssertSchema.html#schema_path-instance_method" title="ActiveModelSerializers::Test::Schema::AssertSchema#schema_path (method)">#schema_path</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (AssertRequestSchema) <strong>initialize</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of AssertRequestSchema.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="AssertSchema.html" title="ActiveModelSerializers::Test::Schema::AssertSchema (class)">AssertSchema</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="AssertSchema.html#call-instance_method" title="ActiveModelSerializers::Test::Schema::AssertSchema#call (method)">#call</a></span></p>
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Test::Schema::AssertRequestSchema (class)">AssertRequestSchema</a></span></tt>) <strong>initialize</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of AssertRequestSchema</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
131
|
||||
132
|
||||
133
|
||||
134</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 131</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span>
|
||||
<span class='ivar'>@payload</span> <span class='op'>=</span> <span class='id identifier rubyid_request_params'>request_params</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,222 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Test::Schema::AssertResponseSchema
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModelSerializers/Test/Schema/AssertResponseSchema.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../../Test.html" title="ActiveModelSerializers::Test (module)">Test</a></span></span> » <span class='title'><span class='object_link'><a href="../Schema.html" title="ActiveModelSerializers::Test::Schema (module)">Schema</a></span></span>
|
||||
»
|
||||
<span class="title">AssertResponseSchema</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Test::Schema::AssertResponseSchema
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName"><span class='object_link'><a href="AssertSchema.html" title="ActiveModelSerializers::Test::Schema::AssertSchema (class)">AssertSchema</a></span></span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next"><span class='object_link'><a href="AssertSchema.html" title="ActiveModelSerializers::Test::Schema::AssertSchema (class)">AssertSchema</a></span></li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Test::Schema::AssertResponseSchema</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/test/schema.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary</h2>
|
||||
|
||||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="AssertSchema.html" title="ActiveModelSerializers::Test::Schema::AssertSchema (class)">AssertSchema</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="AssertSchema.html#message-instance_method" title="ActiveModelSerializers::Test::Schema::AssertSchema#message (method)">#message</a></span>, <span class='object_link'><a href="AssertSchema.html#payload-instance_method" title="ActiveModelSerializers::Test::Schema::AssertSchema#payload (method)">#payload</a></span>, <span class='object_link'><a href="AssertSchema.html#request-instance_method" title="ActiveModelSerializers::Test::Schema::AssertSchema#request (method)">#request</a></span>, <span class='object_link'><a href="AssertSchema.html#response-instance_method" title="ActiveModelSerializers::Test::Schema::AssertSchema#response (method)">#response</a></span>, <span class='object_link'><a href="AssertSchema.html#schema_path-instance_method" title="ActiveModelSerializers::Test::Schema::AssertSchema#schema_path (method)">#schema_path</a></span></p>
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (AssertResponseSchema) <strong>initialize</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of AssertResponseSchema.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="AssertSchema.html" title="ActiveModelSerializers::Test::Schema::AssertSchema (class)">AssertSchema</a></span></h3>
|
||||
<p class="inherited"><span class='object_link'><a href="AssertSchema.html#call-instance_method" title="ActiveModelSerializers::Test::Schema::AssertSchema#call (method)">#call</a></span></p>
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Test::Schema::AssertResponseSchema (class)">AssertResponseSchema</a></span></tt>) <strong>initialize</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of AssertResponseSchema</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
125
|
||||
126
|
||||
127
|
||||
128</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 125</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='rparen'>)</span>
|
||||
<span class='kw'>super</span>
|
||||
<span class='ivar'>@payload</span> <span class='op'>=</span> <span class='id identifier rubyid_response_body'>response_body</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,654 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Test::Schema::AssertSchema
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModelSerializers/Test/Schema/AssertSchema.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../../Test.html" title="ActiveModelSerializers::Test (module)">Test</a></span></span> » <span class='title'><span class='object_link'><a href="../Schema.html" title="ActiveModelSerializers::Test::Schema (module)">Schema</a></span></span>
|
||||
»
|
||||
<span class="title">AssertSchema</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Test::Schema::AssertSchema
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Test::Schema::AssertSchema</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/test/schema.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div id="subclasses">
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class="children"><span class='object_link'><a href="AssertRequestSchema.html" title="ActiveModelSerializers::Test::Schema::AssertRequestSchema (class)">AssertRequestSchema</a></span>, <span class='object_link'><a href="AssertResponseSchema.html" title="ActiveModelSerializers::Test::Schema::AssertResponseSchema (class)">AssertResponseSchema</a></span></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#message-instance_method" title="#message (instance method)">- (Object) <strong>message</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute message.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#payload-instance_method" title="#payload (instance method)">- (Object) <strong>payload</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute payload.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#request-instance_method" title="#request (instance method)">- (Object) <strong>request</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute request.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#response-instance_method" title="#response (instance method)">- (Object) <strong>response</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute response.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#schema_path-instance_method" title="#schema_path (instance method)">- (Object) <strong>schema_path</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute schema_path.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#call-instance_method" title="#call (instance method)">- (Object) <strong>call</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (AssertSchema) <strong>initialize</strong>(schema_path, request, response, message, payload = nil) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Interface may change.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Test::Schema::AssertSchema (class)">AssertSchema</a></span></tt>) <strong>initialize</strong>(schema_path, request, response, message, payload = nil)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Interface may change.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
40
|
||||
41
|
||||
42
|
||||
43
|
||||
44
|
||||
45
|
||||
46
|
||||
47
|
||||
48
|
||||
49</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 40</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_schema_path'>schema_path</span><span class='comma'>,</span> <span class='id identifier rubyid_request'>request</span><span class='comma'>,</span> <span class='id identifier rubyid_response'>response</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_require_json_schema!'>require_json_schema!</span>
|
||||
<span class='ivar'>@request</span> <span class='op'>=</span> <span class='id identifier rubyid_request'>request</span>
|
||||
<span class='ivar'>@response</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span>
|
||||
<span class='ivar'>@payload</span> <span class='op'>=</span> <span class='id identifier rubyid_payload'>payload</span>
|
||||
<span class='ivar'>@schema_path</span> <span class='op'>=</span> <span class='id identifier rubyid_schema_path'>schema_path</span> <span class='op'>||</span> <span class='id identifier rubyid_schema_path_default'>schema_path_default</span>
|
||||
<span class='ivar'>@message</span> <span class='op'>=</span> <span class='id identifier rubyid_message'>message</span>
|
||||
<span class='ivar'>@document_store</span> <span class='op'>=</span> <span class='const'>JsonSchema</span><span class='op'>::</span><span class='const'>DocumentStore</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
||||
<span class='id identifier rubyid_add_schema_to_document_store'>add_schema_to_document_store</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="instance_attr_details" class="attr_details">
|
||||
<h2>Instance Attribute Details</h2>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="message-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>message</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute message</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
37
|
||||
38
|
||||
39</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 37</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_message'>message</span>
|
||||
<span class='ivar'>@message</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="payload-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>payload</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute payload</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
37
|
||||
38
|
||||
39</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 37</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_payload'>payload</span>
|
||||
<span class='ivar'>@payload</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="request-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>request</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute request</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
37
|
||||
38
|
||||
39</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 37</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_request'>request</span>
|
||||
<span class='ivar'>@request</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="response-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>response</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute response</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
37
|
||||
38
|
||||
39</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 37</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_response'>response</span>
|
||||
<span class='ivar'>@response</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="schema_path-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>schema_path</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute schema_path</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
37
|
||||
38
|
||||
39</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 37</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_schema_path'>schema_path</span>
|
||||
<span class='ivar'>@schema_path</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="call-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>call</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
51
|
||||
52
|
||||
53
|
||||
54
|
||||
55
|
||||
56</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/schema.rb', line 51</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span>
|
||||
<span class='id identifier rubyid_json_schema'>json_schema</span><span class='period'>.</span><span class='id identifier rubyid_expand_references!'>expand_references!</span><span class='lparen'>(</span><span class='label'>store:</span> <span class='id identifier rubyid_document_store'>document_store</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='id identifier rubyid_errors'>errors</span> <span class='op'>=</span> <span class='id identifier rubyid_json_schema'>json_schema</span><span class='period'>.</span><span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='id identifier rubyid_response_body'>response_body</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@message</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:to_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_sentence'>to_sentence</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>: </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_status'>status</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,227 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: ActiveModelSerializers::Test::Serializer
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!ActiveModelSerializers/Test/Serializer.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (S)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../Test.html" title="ActiveModelSerializers::Test (module)">Test</a></span></span>
|
||||
»
|
||||
<span class="title">Serializer</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: ActiveModelSerializers::Test::Serializer
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Concern</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/test/serializer.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
|
||||
|
||||
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Serializer/AssertSerializer.html" title="ActiveModelSerializers::Test::Serializer::AssertSerializer (class)">AssertSerializer</a></span>
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#assert_serializer-instance_method" title="#assert_serializer (instance method)">- (Object) <strong>assert_serializer</strong>(expectation, message = nil) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Asserts that the request was rendered with the appropriate serializers.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="assert_serializer-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>assert_serializer</strong>(expectation, message = nil)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Asserts that the request was rendered with the appropriate serializers.</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='comment'># assert that the "PostSerializer" serializer was rendered
|
||||
</span><span class='id identifier rubyid_assert_serializer'>assert_serializer</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>PostSerializer</span><span class='tstring_end'>"</span></span>
|
||||
|
||||
<span class='comment'># return a custom error message
|
||||
</span><span class='id identifier rubyid_assert_serializer'>assert_serializer</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>PostSerializer</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>PostSerializer not rendered</span><span class='tstring_end'>"</span></span>
|
||||
|
||||
<span class='comment'># assert that the instance of PostSerializer was rendered
|
||||
</span><span class='id identifier rubyid_assert_serializer'>assert_serializer</span> <span class='const'>PostSerializer</span>
|
||||
|
||||
<span class='comment'># assert that the "PostSerializer" serializer was rendered
|
||||
</span><span class='id identifier rubyid_assert_serializer'>assert_serializer</span> <span class='symbol'>:post_serializer</span>
|
||||
|
||||
<span class='comment'># assert that the rendered serializer starts with "Post"
|
||||
</span><span class='id identifier rubyid_assert_serializer'>assert_serializer</span> <span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>\APost.+\Z</span><span class='regexp_end'>}</span></span>
|
||||
|
||||
<span class='comment'># assert that no serializer was rendered
|
||||
</span><span class='id identifier rubyid_assert_serializer'>assert_serializer</span> <span class='kw'>nil</span>
|
||||
</code></pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/serializer.rb', line 32</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_assert_serializer'>assert_serializer</span><span class='lparen'>(</span><span class='id identifier rubyid_expectation'>expectation</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||||
<span class='ivar'>@assert_serializer</span><span class='period'>.</span><span class='id identifier rubyid_expectation'>expectation</span> <span class='op'>=</span> <span class='id identifier rubyid_expectation'>expectation</span>
|
||||
<span class='ivar'>@assert_serializer</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='id identifier rubyid_message'>message</span>
|
||||
<span class='ivar'>@assert_serializer</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span>
|
||||
<span class='id identifier rubyid_assert'>assert</span><span class='lparen'>(</span><span class='ivar'>@assert_serializer</span><span class='period'>.</span><span class='id identifier rubyid_matches?'>matches?</span><span class='comma'>,</span> <span class='ivar'>@assert_serializer</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,710 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: ActiveModelSerializers::Test::Serializer::AssertSerializer
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../../';
|
||||
framesUrl = "../../../frames.html#!ActiveModelSerializers/Test/Serializer/AssertSerializer.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../../ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span></span> » <span class='title'><span class='object_link'><a href="../../Test.html" title="ActiveModelSerializers::Test (module)">Test</a></span></span> » <span class='title'><span class='object_link'><a href="../Serializer.html" title="ActiveModelSerializers::Test::Serializer (module)">Serializer</a></span></span>
|
||||
»
|
||||
<span class="title">AssertSerializer</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: ActiveModelSerializers::Test::Serializer::AssertSerializer
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">ActiveModelSerializers::Test::Serializer::AssertSerializer</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/active_model_serializers/test/serializer.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#expectation-instance_method" title="#expectation (instance method)">- (Object) <strong>expectation</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute expectation.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#message-instance_method" title="#message (instance method)">- (Object) <strong>message</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute message.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#response-instance_method" title="#response (instance method)">- (Object) <strong>response</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute response.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#serializers-instance_method" title="#serializers (instance method)">- (Object) <strong>serializers</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="note title readonly">readonly</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>Returns the value of attribute serializers.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#initialize-instance_method" title="#initialize (instance method)">- (AssertSerializer) <strong>initialize</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="note title constructor">constructor</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A new instance of AssertSerializer.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#matches%3F-instance_method" title="#matches? (instance method)">- (Boolean) <strong>matches?</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#subscribe-instance_method" title="#subscribe (instance method)">- (Object) <strong>subscribe</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#unsubscribe-instance_method" title="#unsubscribe (instance method)">- (Object) <strong>unsubscribe</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="constructor_details" class="method_details_list">
|
||||
<h2>Constructor Details</h2>
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="initialize-instance_method">
|
||||
|
||||
- (<tt><span class='object_link'><a href="" title="ActiveModelSerializers::Test::Serializer::AssertSerializer (class)">AssertSerializer</a></span></tt>) <strong>initialize</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns a new instance of AssertSerializer</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
43
|
||||
44
|
||||
45
|
||||
46</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/serializer.rb', line 43</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
||||
<span class='ivar'>@serializers</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
||||
<span class='ivar'>@_subscribers</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="instance_attr_details" class="attr_details">
|
||||
<h2>Instance Attribute Details</h2>
|
||||
|
||||
|
||||
<span id="expectation=-instance_method"></span>
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="expectation-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>expectation</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute expectation</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
41
|
||||
42
|
||||
43</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/serializer.rb', line 41</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_expectation'>expectation</span>
|
||||
<span class='ivar'>@expectation</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id="message=-instance_method"></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="message-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>message</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute message</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
40
|
||||
41
|
||||
42</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/serializer.rb', line 40</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_message'>message</span>
|
||||
<span class='ivar'>@message</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id="response=-instance_method"></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="response-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>response</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute response</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
41
|
||||
42
|
||||
43</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/serializer.rb', line 41</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_response'>response</span>
|
||||
<span class='ivar'>@response</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<span id=""></span>
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="serializers-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>serializers</strong> <span class="extras">(readonly)</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>Returns the value of attribute serializers</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
40
|
||||
41
|
||||
42</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/serializer.rb', line 40</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_serializers'>serializers</span>
|
||||
<span class='ivar'>@serializers</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="matches?-instance_method">
|
||||
|
||||
- (<tt>Boolean</tt>) <strong>matches?</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
<p class="tag_title">Returns:</p>
|
||||
<ul class="return">
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
52
|
||||
53
|
||||
54
|
||||
55
|
||||
56
|
||||
57
|
||||
58
|
||||
59
|
||||
60
|
||||
61
|
||||
62
|
||||
63
|
||||
64</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/serializer.rb', line 52</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_matches?'>matches?</span>
|
||||
<span class='comment'># Force body to be read in case the template is being streamed.
|
||||
</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
|
||||
|
||||
<span class='kw'>case</span> <span class='id identifier rubyid_expectation'>expectation</span>
|
||||
<span class='kw'>when</span> <span class='id identifier rubyid_a_serializer?'>a_serializer?</span> <span class='kw'>then</span> <span class='id identifier rubyid_matches_class?'>matches_class?</span>
|
||||
<span class='kw'>when</span> <span class='const'>Symbol</span> <span class='kw'>then</span> <span class='id identifier rubyid_matches_symbol?'>matches_symbol?</span>
|
||||
<span class='kw'>when</span> <span class='const'>String</span> <span class='kw'>then</span> <span class='id identifier rubyid_matches_string?'>matches_string?</span>
|
||||
<span class='kw'>when</span> <span class='const'>Regexp</span> <span class='kw'>then</span> <span class='id identifier rubyid_matches_regexp?'>matches_regexp?</span>
|
||||
<span class='kw'>when</span> <span class='const'>NilClass</span> <span class='kw'>then</span> <span class='id identifier rubyid_matches_nil?'>matches_nil?</span>
|
||||
<span class='kw'>else</span> <span class='id identifier rubyid_fail'>fail</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>assert_serializer only accepts a String, Symbol, Regexp, ActiveModel::Serializer, or nil</span><span class='tstring_end'>'</span></span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="subscribe-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>subscribe</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
66
|
||||
67
|
||||
68
|
||||
69
|
||||
70
|
||||
71</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/serializer.rb', line 66</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_subscribe'>subscribe</span>
|
||||
<span class='ivar'>@_subscribers</span> <span class='op'><<</span> <span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>Notifications</span><span class='period'>.</span><span class='id identifier rubyid_subscribe'>subscribe</span><span class='lparen'>(</span><span class='id identifier rubyid_event_name'>event_name</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid__name'>_name</span><span class='comma'>,</span> <span class='id identifier rubyid__start'>_start</span><span class='comma'>,</span> <span class='id identifier rubyid__finish'>_finish</span><span class='comma'>,</span> <span class='id identifier rubyid__id'>_id</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='op'>|</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span> <span class='op'>=</span> <span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:serializer</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span>
|
||||
<span class='id identifier rubyid_serializers'>serializers</span> <span class='op'><<</span> <span class='id identifier rubyid_serializer'>serializer</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="method_details ">
|
||||
<h3 class="signature " id="unsubscribe-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>unsubscribe</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
73
|
||||
74
|
||||
75
|
||||
76
|
||||
77</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/active_model_serializers/test/serializer.rb', line 73</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_unsubscribe'>unsubscribe</span>
|
||||
<span class='ivar'>@_subscribers</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_subscriber'>subscriber</span><span class='op'>|</span>
|
||||
<span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>Notifications</span><span class='period'>.</span><span class='id identifier rubyid_unsubscribe'>unsubscribe</span><span class='lparen'>(</span><span class='id identifier rubyid_subscriber'>subscriber</span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
133
Grape.html
133
Grape.html
@ -1,133 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: Grape
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '';
|
||||
framesUrl = "frames.html#!Grape.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="_index.html">Index (G)</a> »
|
||||
|
||||
|
||||
<span class="title">Grape</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: Grape
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/grape/helpers/active_model_serializers.rb<span class="defines">,<br />
|
||||
lib/grape/formatters/active_model_serializers.rb</span>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Overview</h2><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>A Grape response formatter that can be used as 'formatter :json,
|
||||
Grape::Formatters::ActiveModelSerializers'</p>
|
||||
|
||||
<p>Serializer options can be passed as a hash from your Grape endpoint using
|
||||
<a href=":active_model_serializer_options">env</a>, or better yet user the
|
||||
render helper in Grape::Helpers::ActiveModelSerializers</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Grape/ActiveModelSerializers.html" title="Grape::ActiveModelSerializers (module)">ActiveModelSerializers</a></span>, <span class='object_link'><a href="Grape/Formatters.html" title="Grape::Formatters (module)">Formatters</a></span>, <span class='object_link'><a href="Grape/Helpers.html" title="Grape::Helpers (module)">Helpers</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,110 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: Grape::ActiveModelSerializers
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!Grape/ActiveModelSerializers.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../Grape.html" title="Grape (module)">Grape</a></span></span>
|
||||
»
|
||||
<span class="title">ActiveModelSerializers</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: Grape::ActiveModelSerializers
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
<dt class="r1">Extended by:</dt>
|
||||
<dd class="r1">ActiveSupport::Concern</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/grape/active_model_serializers.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,115 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: Grape::Formatters
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!Grape/Formatters.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (F)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../Grape.html" title="Grape (module)">Grape</a></span></span>
|
||||
»
|
||||
<span class="title">Formatters</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: Grape::Formatters
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/grape/formatters/active_model_serializers.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Formatters/ActiveModelSerializers.html" title="Grape::Formatters::ActiveModelSerializers (module)">ActiveModelSerializers</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,178 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: Grape::Formatters::ActiveModelSerializers
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!Grape/Formatters/ActiveModelSerializers.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../Grape.html" title="Grape (module)">Grape</a></span></span> » <span class='title'><span class='object_link'><a href="../Formatters.html" title="Grape::Formatters (module)">Formatters</a></span></span>
|
||||
»
|
||||
<span class="title">ActiveModelSerializers</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: Grape::Formatters::ActiveModelSerializers
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/grape/formatters/active_model_serializers.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Class Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#call-class_method" title="call (class method)">+ (Object) <strong>call</strong>(resource, env) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="class_method_details" class="method_details_list">
|
||||
<h2>Class Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="call-class_method">
|
||||
|
||||
+ (<tt>Object</tt>) <strong>call</strong>(resource, env)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/grape/formatters/active_model_serializers.rb', line 8</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_env'>env</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serializer_options'>serializer_options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_serializer_options'>serializer_options</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='symbol'>:active_model_serializer_options</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='symbol'>:active_model_serializer_options</span><span class='rbracket'>]</span>
|
||||
<span class='op'>::</span><span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>SerializableResource</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_serializer_options'>serializer_options</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,115 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: Grape::Helpers
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!Grape/Helpers.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (H)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../Grape.html" title="Grape (module)">Grape</a></span></span>
|
||||
»
|
||||
<span class="title">Helpers</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: Grape::Helpers
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/grape/helpers/active_model_serializers.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Helpers/ActiveModelSerializers.html" title="Grape::Helpers::ActiveModelSerializers (module)">ActiveModelSerializers</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,195 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: Grape::Helpers::ActiveModelSerializers
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!Grape/Helpers/ActiveModelSerializers.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (A)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../Grape.html" title="Grape (module)">Grape</a></span></span> » <span class='title'><span class='object_link'><a href="../Helpers.html" title="Grape::Helpers (module)">Helpers</a></span></span>
|
||||
»
|
||||
<span class="title">ActiveModelSerializers</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: Grape::Helpers::ActiveModelSerializers
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/grape/helpers/active_model_serializers.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#render-instance_method" title="#render (instance method)">- (Object) <strong>render</strong>(resource, active_model_serializer_options = {}) </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'>
|
||||
<p>A convenience method for passing ActiveModelSerializers serializer options.</p>
|
||||
</div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="render-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>render</strong>(resource, active_model_serializer_options = {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><div class="docstring">
|
||||
<div class="discussion">
|
||||
|
||||
<p>A convenience method for passing ActiveModelSerializers serializer options</p>
|
||||
|
||||
<p>Example: To include relationships in the response: render(post, include:
|
||||
['comments'])</p>
|
||||
|
||||
<p>Example: To include pagination meta data: render(posts, meta: { page:
|
||||
posts.page, total_pages: posts.total_pages })</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
</div><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
10
|
||||
11
|
||||
12
|
||||
13</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/grape/helpers/active_model_serializers.rb', line 10</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_active_model_serializer_options'>active_model_serializer_options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='symbol'>:active_model_serializer_options</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_active_model_serializer_options'>active_model_serializer_options</span>
|
||||
<span class='id identifier rubyid_resource'>resource</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:37 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
117
Rails.html
117
Rails.html
@ -1,117 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: Rails
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '';
|
||||
framesUrl = "frames.html#!Rails.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="_index.html">Index (R)</a> »
|
||||
|
||||
|
||||
<span class="title">Rails</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: Rails
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/generators/rails/resource_override.rb<span class="defines">,<br />
|
||||
lib/generators/rails/serializer_generator.rb</span>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Rails/Generators.html" title="Rails::Generators (module)">Generators</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,117 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Module: Rails::Generators
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../';
|
||||
framesUrl = "../frames.html#!Rails/Generators.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../_index.html">Index (G)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../Rails.html" title="Rails (module)">Rails</a></span></span>
|
||||
»
|
||||
<span class="title">Generators</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Module: Rails::Generators
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r1 last">Defined in:</dt>
|
||||
<dd class="r1 last">lib/generators/rails/resource_override.rb<span class="defines">,<br />
|
||||
lib/generators/rails/serializer_generator.rb</span>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2>Defined Under Namespace</h2>
|
||||
<p class="children">
|
||||
|
||||
|
||||
|
||||
|
||||
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Generators/ResourceGenerator.html" title="Rails::Generators::ResourceGenerator (class)">ResourceGenerator</a></span>, <span class='object_link'><a href="Generators/SerializerGenerator.html" title="Rails::Generators::SerializerGenerator (class)">SerializerGenerator</a></span>
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:36 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,120 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: Rails::Generators::ResourceGenerator
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!Rails/Generators/ResourceGenerator.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (R)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../Rails.html" title="Rails (module)">Rails</a></span></span> » <span class='title'><span class='object_link'><a href="../Generators.html" title="Rails::Generators (module)">Generators</a></span></span>
|
||||
»
|
||||
<span class="title">ResourceGenerator</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: Rails::Generators::ResourceGenerator
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">Object</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">Rails::Generators::ResourceGenerator</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/generators/rails/resource_override.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:38 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,192 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Class: Rails::Generators::SerializerGenerator
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '../../';
|
||||
framesUrl = "../../frames.html#!Rails/Generators/SerializerGenerator.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="../../_index.html">Index (S)</a> »
|
||||
<span class='title'><span class='object_link'><a href="../../Rails.html" title="Rails (module)">Rails</a></span></span> » <span class='title'><span class='object_link'><a href="../Generators.html" title="Rails::Generators (module)">Generators</a></span></span>
|
||||
»
|
||||
<span class="title">SerializerGenerator</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="../../class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="../../method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="../../file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1>Class: Rails::Generators::SerializerGenerator
|
||||
|
||||
|
||||
|
||||
</h1>
|
||||
|
||||
<dl class="box">
|
||||
|
||||
<dt class="r1">Inherits:</dt>
|
||||
<dd class="r1">
|
||||
<span class="inheritName">NamedBase</span>
|
||||
|
||||
<ul class="fullTree">
|
||||
<li>Object</li>
|
||||
|
||||
<li class="next">NamedBase</li>
|
||||
|
||||
<li class="next">Rails::Generators::SerializerGenerator</li>
|
||||
|
||||
</ul>
|
||||
<a href="#" class="inheritanceTree">show all</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="r2 last">Defined in:</dt>
|
||||
<dd class="r2 last">lib/generators/rails/serializer_generator.rb</dd>
|
||||
|
||||
</dl>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>
|
||||
Instance Method Summary
|
||||
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
||||
</h2>
|
||||
|
||||
<ul class="summary">
|
||||
|
||||
<li class="public ">
|
||||
<span class="summary_signature">
|
||||
|
||||
<a href="#create_serializer_file-instance_method" title="#create_serializer_file (instance method)">- (Object) <strong>create_serializer_file</strong> </a>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="summary_desc"><div class='inline'></div></span>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="instance_method_details" class="method_details_list">
|
||||
<h2>Instance Method Details</h2>
|
||||
|
||||
|
||||
<div class="method_details first">
|
||||
<h3 class="signature first" id="create_serializer_file-instance_method">
|
||||
|
||||
- (<tt>Object</tt>) <strong>create_serializer_file</strong>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3><table class="source_code">
|
||||
<tr>
|
||||
<td>
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
11
|
||||
12
|
||||
13</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'lib/generators/rails/serializer_generator.rb', line 11</span>
|
||||
|
||||
<span class='kw'>def</span> <span class='id identifier rubyid_create_serializer_file'>create_serializer_file</span>
|
||||
<span class='id identifier rubyid_template'>template</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>serializer.rb.erb</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>app/serializers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_class_path'>class_path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file_name'>file_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>_serializer.rb</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
||||
<span class='kw'>end</span></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:39 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
874
_index.html
874
_index.html
@ -1,874 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>
|
||||
Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '';
|
||||
framesUrl = "frames.html#!_index.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><h1 class="noborder title">Documentation by YARD 0.8.7.6</h1>
|
||||
<div id="listing">
|
||||
<h1 class="alphaindex">Alphabetic Index</h1>
|
||||
|
||||
<h2>File Listing</h2>
|
||||
<ul id="files" class="index_inline_list">
|
||||
|
||||
|
||||
<li class="r1"><a href="index.html" title="README">README</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="clear"></div>
|
||||
<h2>Namespace Listing A-Z</h2>
|
||||
|
||||
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td valign='top' width="33%">
|
||||
|
||||
|
||||
<ul id="alpha_A" class="alpha">
|
||||
<li class="letter">A</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActionController.html" title="ActionController (module)">ActionController</a></span>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel.html" title="ActiveModel (module)">ActiveModel</a></span>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="Grape/ActiveModelSerializers.html" title="Grape::ActiveModelSerializers (module)">ActiveModelSerializers</a></span>
|
||||
|
||||
<small>(Grape)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="Grape/Formatters/ActiveModelSerializers.html" title="Grape::Formatters::ActiveModelSerializers (module)">ActiveModelSerializers</a></span>
|
||||
|
||||
<small>(Grape::Formatters)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="Grape/Helpers/ActiveModelSerializers.html" title="Grape::Helpers::ActiveModelSerializers (module)">ActiveModelSerializers</a></span>
|
||||
|
||||
<small>(Grape::Helpers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers.html" title="ActiveModelSerializers (module)">ActiveModelSerializers</a></span>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Adapter.html" title="ActiveModel::Serializer::Adapter (module)">Adapter</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter.html" title="ActiveModelSerializers::Adapter (module)">Adapter</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/ArraySerializer.html" title="ActiveModel::Serializer::ArraySerializer (class)">ArraySerializer</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Test/Schema/AssertRequestSchema.html" title="ActiveModelSerializers::Test::Schema::AssertRequestSchema (class)">AssertRequestSchema</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Test::Schema)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Test/Schema/AssertResponseSchema.html" title="ActiveModelSerializers::Test::Schema::AssertResponseSchema (class)">AssertResponseSchema</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Test::Schema)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Test/Schema/AssertSchema.html" title="ActiveModelSerializers::Test::Schema::AssertSchema (class)">AssertSchema</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Test::Schema)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Test/Serializer/AssertSerializer.html" title="ActiveModelSerializers::Test::Serializer::AssertSerializer (class)">AssertSerializer</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Test::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Association.html" title="ActiveModel::Serializer::Association (class)">Association</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Associations.html" title="ActiveModel::Serializer::Associations (module)">Associations</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Attribute.html" title="ActiveModel::Serializer::Attribute (class)">Attribute</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/Attributes.html" title="ActiveModelSerializers::Adapter::Attributes (class)">Attributes</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Adapter/Attributes.html" title="ActiveModel::Serializer::Adapter::Attributes (class)">Attributes</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer::Adapter)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Attributes.html" title="ActiveModel::Serializer::Attributes (module)">Attributes</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_B" class="alpha">
|
||||
<li class="letter">B</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Adapter/Base.html" title="ActiveModel::Serializer::Adapter::Base (class)">Base</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer::Adapter)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/Base.html" title="ActiveModelSerializers::Adapter::Base (class)">Base</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/BelongsToReflection.html" title="ActiveModel::Serializer::BelongsToReflection (class)">BelongsToReflection</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_C" class="alpha">
|
||||
<li class="letter">C</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Caching.html" title="ActiveModel::Serializer::Caching (module)">Caching</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Callbacks.html" title="ActiveModelSerializers::Callbacks (module)">Callbacks</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Attributes/ClassMethods.html" title="ActiveModel::Serializer::Attributes::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer::Attributes)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Callbacks/ClassMethods.html" title="ActiveModelSerializers::Callbacks::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Callbacks)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Caching/ClassMethods.html" title="ActiveModel::Serializer::Caching::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer::Caching)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActionController/Serialization/ClassMethods.html" title="ActionController::Serialization::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
<small>(ActionController::Serialization)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Associations/ClassMethods.html" title="ActiveModel::Serializer::Associations::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer::Associations)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Logging/ClassMethods.html" title="ActiveModelSerializers::Logging::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Logging)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Type/ClassMethods.html" title="ActiveModel::Serializer::Type::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer::Type)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Links/ClassMethods.html" title="ActiveModel::Serializer::Links::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer::Links)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Meta/ClassMethods.html" title="ActiveModel::Serializer::Meta::ClassMethods (module)">ClassMethods</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer::Meta)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/CollectionReflection.html" title="ActiveModel::Serializer::CollectionReflection (class)">CollectionReflection</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/CollectionSerializer.html" title="ActiveModel::Serializer::CollectionSerializer (class)">CollectionSerializer</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Configuration.html" title="ActiveModel::Serializer::Configuration (module)">Configuration</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Jsonapi/ControllerSupport.html" title="ActiveModelSerializers::Jsonapi::ControllerSupport (module)">ControllerSupport</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Jsonapi)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_D" class="alpha">
|
||||
<li class="letter">D</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Deprecate.html" title="ActiveModelSerializers::Deprecate (module)">Deprecate</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Deserialization.html" title="ActiveModelSerializers::Deserialization (module)">Deserialization</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/JsonApi/Deserialization.html" title="ActiveModelSerializers::Adapter::JsonApi::Deserialization (module)">Deserialization</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter::JsonApi)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_E" class="alpha">
|
||||
<li class="letter">E</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/JsonApi/Error.html" title="ActiveModelSerializers::Adapter::JsonApi::Error (module)">Error</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter::JsonApi)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/ErrorSerializer.html" title="ActiveModel::Serializer::ErrorSerializer (class)">ErrorSerializer</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/ErrorsSerializer.html" title="ActiveModel::Serializer::ErrorsSerializer (class)">ErrorsSerializer</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_F" class="alpha">
|
||||
<li class="letter">F</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Field.html" title="ActiveModel::Serializer::Field (class)">Field</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Fieldset.html" title="ActiveModel::Serializer::Fieldset (class)">Fieldset</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="Grape/Formatters.html" title="Grape::Formatters (module)">Formatters</a></span>
|
||||
|
||||
<small>(Grape)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_G" class="alpha">
|
||||
<li class="letter">G</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="Rails/Generators.html" title="Rails::Generators (module)">Generators</a></span>
|
||||
|
||||
<small>(Rails)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="Grape.html" title="Grape (module)">Grape</a></span>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
</td><td valign='top' width="33%">
|
||||
|
||||
|
||||
<ul id="alpha_H" class="alpha">
|
||||
<li class="letter">H</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/HasManyReflection.html" title="ActiveModel::Serializer::HasManyReflection (class)">HasManyReflection</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/HasOneReflection.html" title="ActiveModel::Serializer::HasOneReflection (class)">HasOneReflection</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="Grape/Helpers.html" title="Grape::Helpers (module)">Helpers</a></span>
|
||||
|
||||
<small>(Grape)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_J" class="alpha">
|
||||
<li class="letter">J</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Adapter/Json.html" title="ActiveModel::Serializer::Adapter::Json (class)">Json</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer::Adapter)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/Json.html" title="ActiveModelSerializers::Adapter::Json (class)">Json</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Adapter/JsonApi.html" title="ActiveModel::Serializer::Adapter::JsonApi (class)">JsonApi</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer::Adapter)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/JsonApi.html" title="ActiveModelSerializers::Adapter::JsonApi (class)">JsonApi</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/JsonPointer.html" title="ActiveModelSerializers::JsonPointer (module)">JsonPointer</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Jsonapi.html" title="ActiveModelSerializers::Jsonapi (module)">Jsonapi</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/JsonApi/Jsonapi.html" title="ActiveModelSerializers::Adapter::JsonApi::Jsonapi (module)">Jsonapi</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter::JsonApi)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_K" class="alpha">
|
||||
<li class="letter">K</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/KeyTransform.html" title="ActiveModelSerializers::KeyTransform (module)">KeyTransform</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_L" class="alpha">
|
||||
<li class="letter">L</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/JsonApi/Link.html" title="ActiveModelSerializers::Adapter::JsonApi::Link (class)">Link</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter::JsonApi)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Links.html" title="ActiveModel::Serializer::Links (module)">Links</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Lint.html" title="ActiveModel::Serializer::Lint (module)">Lint</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Logging/LogSubscriber.html" title="ActiveModelSerializers::Logging::LogSubscriber (class)">LogSubscriber</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Logging)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Logging.html" title="ActiveModelSerializers::Logging (module)">Logging</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_M" class="alpha">
|
||||
<li class="letter">M</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Logging/Macros.html" title="ActiveModelSerializers::Logging::Macros (module)">Macros</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Logging)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/JsonApi/Meta.html" title="ActiveModelSerializers::Adapter::JsonApi::Meta (class)">Meta</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter::JsonApi)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Meta.html" title="ActiveModel::Serializer::Meta (module)">Meta</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Model.html" title="ActiveModelSerializers::Model (class)">Model</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_N" class="alpha">
|
||||
<li class="letter">N</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/Null.html" title="ActiveModelSerializers::Adapter::Null (class)">Null</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Adapter/Null.html" title="ActiveModel::Serializer::Adapter::Null (class)">Null</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer::Adapter)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Null.html" title="ActiveModel::Serializer::Null (class)">Null</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_P" class="alpha">
|
||||
<li class="letter">P</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/JsonApi/PaginationLinks.html" title="ActiveModelSerializers::Adapter::JsonApi::PaginationLinks (class)">PaginationLinks</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter::JsonApi)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_R" class="alpha">
|
||||
<li class="letter">R</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="Rails.html" title="Rails (module)">Rails</a></span>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Railtie.html" title="ActiveModelSerializers::Railtie (class)">Railtie</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Reflection.html" title="ActiveModel::Serializer::Reflection (class)">Reflection</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/JsonApi/Relationship.html" title="ActiveModelSerializers::Adapter::JsonApi::Relationship (class)">Relationship</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter::JsonApi)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="Rails/Generators/ResourceGenerator.html" title="Rails::Generators::ResourceGenerator (class)">ResourceGenerator</a></span>
|
||||
|
||||
<small>(Rails::Generators)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Adapter/JsonApi/ResourceIdentifier.html" title="ActiveModelSerializers::Adapter::JsonApi::ResourceIdentifier (class)">ResourceIdentifier</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Adapter::JsonApi)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
</td><td valign='top' width="33%">
|
||||
|
||||
|
||||
<ul id="alpha_S" class="alpha">
|
||||
<li class="letter">S</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Test/Schema.html" title="ActiveModelSerializers::Test::Schema (module)">Schema</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Test)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/SerializableResource.html" title="ActiveModel::SerializableResource (class)">SerializableResource</a></span>
|
||||
|
||||
<small>(ActiveModel)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/SerializableResource.html" title="ActiveModelSerializers::SerializableResource (class)">SerializableResource</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActionController/Serialization.html" title="ActionController::Serialization (module)">Serialization</a></span>
|
||||
|
||||
<small>(ActionController)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/SerializationContext.html" title="ActiveModelSerializers::SerializationContext (class)">SerializationContext</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Test/Serializer.html" title="ActiveModelSerializers::Test::Serializer (module)">Serializer</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::Test)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer.html" title="ActiveModel::Serializer (class)">Serializer</a></span>
|
||||
|
||||
<small>(ActiveModel)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="Rails/Generators/SerializerGenerator.html" title="Rails::Generators::SerializerGenerator (class)">SerializerGenerator</a></span>
|
||||
|
||||
<small>(Rails::Generators)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/SingularReflection.html" title="ActiveModel::Serializer::SingularReflection (class)">SingularReflection</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_T" class="alpha">
|
||||
<li class="letter">T</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/Test.html" title="ActiveModelSerializers::Test (module)">Test</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Lint/Tests.html" title="ActiveModel::Serializer::Lint::Tests (module)">Tests</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer::Lint)</small>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModel/Serializer/Type.html" title="ActiveModel::Serializer::Type (module)">Type</a></span>
|
||||
|
||||
<small>(ActiveModel::Serializer)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="alpha_U" class="alpha">
|
||||
<li class="letter">U</li>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="ActiveModelSerializers/SerializationContext/UrlHelpers.html" title="ActiveModelSerializers::SerializationContext::UrlHelpers (module)">UrlHelpers</a></span>
|
||||
|
||||
<small>(ActiveModelSerializers::SerializationContext)</small>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:35 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
/* Override this file with custom rules */
|
||||
@ -1,57 +0,0 @@
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
height: 101%;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; }
|
||||
.clear { clear: both; }
|
||||
#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; }
|
||||
#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; }
|
||||
#full_list { padding: 0; list-style: none; margin-left: 0; }
|
||||
#full_list ul { padding: 0; }
|
||||
#full_list li { padding: 5px; padding-left: 12px; margin: 0; font-size: 1.1em; list-style: none; }
|
||||
#noresults { padding: 7px 12px; }
|
||||
#content.insearch #noresults { margin-left: 7px; }
|
||||
ul.collapsed ul, ul.collapsed li { display: none; }
|
||||
ul.collapsed.search_uncollapsed { display: block; }
|
||||
ul.collapsed.search_uncollapsed li { display: list-item; }
|
||||
li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; }
|
||||
li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; }
|
||||
li { color: #888; cursor: pointer; }
|
||||
li.deprecated { text-decoration: line-through; font-style: italic; }
|
||||
li.r1 { background: #f0f0f0; }
|
||||
li.r2 { background: #fafafa; }
|
||||
li:hover { background: #ddd; }
|
||||
li small:before { content: "("; }
|
||||
li small:after { content: ")"; }
|
||||
li small.search_info { display: none; }
|
||||
a:link, a:visited { text-decoration: none; color: #05a; }
|
||||
li.clicked { background: #05a; color: #ccc; }
|
||||
li.clicked a:link, li.clicked a:visited { color: #eee; }
|
||||
li.clicked a.toggle { opacity: 0.5; background-position: bottom right; }
|
||||
li.collapsed.clicked a.toggle { background-position: top right; }
|
||||
#search input { border: 1px solid #bbb; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
|
||||
#nav { margin-left: 10px; font-size: 0.9em; display: none; color: #aaa; }
|
||||
#nav a:link, #nav a:visited { color: #358; }
|
||||
#nav a:hover { background: transparent; color: #5af; }
|
||||
.frames #nav span:after { content: ' | '; }
|
||||
.frames #nav span:last-child:after { content: ''; }
|
||||
|
||||
.frames #content h1 { margin-top: 0; }
|
||||
.frames li { white-space: nowrap; cursor: normal; }
|
||||
.frames li small { display: block; font-size: 0.8em; }
|
||||
.frames li small:before { content: ""; }
|
||||
.frames li small:after { content: ""; }
|
||||
.frames li small.search_info { display: none; }
|
||||
.frames #search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; }
|
||||
.frames #content.insearch #search { background-position: center right; }
|
||||
.frames #search input { width: 110px; }
|
||||
.frames #nav { display: block; }
|
||||
|
||||
#full_list.insearch li { display: none; }
|
||||
#full_list.insearch li.found { display: list-item; padding-left: 10px; }
|
||||
#full_list.insearch li a.toggle { display: none; }
|
||||
#full_list.insearch li small.search_info { display: block; }
|
||||
339
css/style.css
339
css/style.css
@ -1,339 +0,0 @@
|
||||
body {
|
||||
padding: 0 20px;
|
||||
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
body.frames { padding: 0 5px; }
|
||||
h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; }
|
||||
h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; }
|
||||
h1.title { margin-bottom: 10px; }
|
||||
h1.alphaindex { margin-top: 0; font-size: 22px; }
|
||||
h2 {
|
||||
padding: 0;
|
||||
padding-bottom: 3px;
|
||||
border-bottom: 1px #aaa solid;
|
||||
font-size: 1.4em;
|
||||
margin: 1.8em 0 0.5em;
|
||||
}
|
||||
h2 small { font-weight: normal; font-size: 0.7em; display: block; float: right; }
|
||||
.clear { clear: both; }
|
||||
.inline { display: inline; }
|
||||
.inline p:first-child { display: inline; }
|
||||
.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; }
|
||||
.docstring h1 { font-size: 1.2em; }
|
||||
.docstring h2 { font-size: 1.1em; }
|
||||
.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; }
|
||||
.summary_desc .object_link, .docstring .object_link { font-family: monospace; }
|
||||
.rdoc-term { padding-right: 25px; font-weight: bold; }
|
||||
.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; }
|
||||
|
||||
/* style for <table> */
|
||||
#filecontents table, .docstring table { border-collapse: collapse; }
|
||||
#filecontents table th, #filecontents table td,
|
||||
.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; }
|
||||
#filecontents table tr:nth-child(odd),
|
||||
.docstring table tr:nth-child(odd) { background: #eee; }
|
||||
#filecontents table tr:nth-child(even),
|
||||
.docstring table tr:nth-child(even) { background: #fff; }
|
||||
#filecontents table th, .docstring table th { background: #fff; }
|
||||
|
||||
/* style for <ul> */
|
||||
#filecontents li > p, .docstring li > p { margin: 0px; }
|
||||
#filecontents ul, .docstring ul { padding-left: 20px; }
|
||||
/* style for <dl> */
|
||||
#filecontents dl, .docstring dl { border: 1px solid #ccc; }
|
||||
#filecontents dt, .docstring dt { background: #ddd; font-weight: bold; padding: 3px 5px; }
|
||||
#filecontents dd, .docstring dd { padding: 5px 0px; margin-left: 18px; }
|
||||
#filecontents dd > p, .docstring dd > p { margin: 0px; }
|
||||
|
||||
.note {
|
||||
color: #222;
|
||||
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
||||
background: #e3e4e3; border: 1px solid #d5d5d5; padding: 7px 10px;
|
||||
display: block;
|
||||
}
|
||||
.note.todo { background: #ffffc5; border-color: #ececaa; }
|
||||
.note.returns_void { background: #efefef; }
|
||||
.note.deprecated { background: #ffe5e5; border-color: #e9dada; }
|
||||
.note.private { background: #ffffc5; border-color: #ececaa; }
|
||||
.note.title { padding: 1px 5px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; display: inline; }
|
||||
.summary_signature + .note.title { margin-left: 7px; }
|
||||
h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; }
|
||||
.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
||||
.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; }
|
||||
.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
||||
.note.title.private { background: #d5d5d5; border-color: #c5c5c5; }
|
||||
.note.title.not_defined_here { background: transparent; border: none; font-style: italic; }
|
||||
.discussion .note { margin-top: 6px; }
|
||||
.discussion .note:first-child { margin-top: 0; }
|
||||
|
||||
h3.inherited {
|
||||
font-style: italic;
|
||||
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
||||
font-weight: normal;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
margin-top: 12px;
|
||||
margin-bottom: 3px;
|
||||
font-size: 13px;
|
||||
}
|
||||
p.inherited {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
margin-left: 25px;
|
||||
}
|
||||
|
||||
#filecontents dl.box, dl.box {
|
||||
border: 0;
|
||||
width: 520px;
|
||||
font-size: 1em;
|
||||
}
|
||||
#filecontents dl.box dt, dl.box dt {
|
||||
float: left;
|
||||
display: block;
|
||||
width: 100px;
|
||||
margin: 0;
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
background: transparent;
|
||||
border: 1px solid #aaa;
|
||||
border-width: 1px 0px 0px 1px;
|
||||
padding: 6px 0;
|
||||
padding-right: 10px;
|
||||
}
|
||||
#filecontents dl.box dd, dl.box dd {
|
||||
float: left;
|
||||
display: block;
|
||||
width: 380px;
|
||||
margin: 0;
|
||||
padding: 6px 0;
|
||||
padding-right: 20px;
|
||||
border: 1px solid #aaa;
|
||||
border-width: 1px 1px 0 0;
|
||||
}
|
||||
#filecontents dl.box .last, dl.box .last {
|
||||
border-bottom: 1px solid #aaa;
|
||||
}
|
||||
#filecontents dl.box .r1, dl.box .r1 { background: #eee; }
|
||||
|
||||
ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; }
|
||||
.index_inline_list { padding-left: 0; font-size: 1.1em; }
|
||||
.index_inline_list li { list-style: none; display: inline; padding: 7px 12px; line-height: 35px; }
|
||||
|
||||
dl.constants { margin-left: 40px; }
|
||||
dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; }
|
||||
dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; }
|
||||
|
||||
.summary_desc { margin-left: 32px; display: block; font-family: sans-serif; }
|
||||
.summary_desc tt { font-size: 0.9em; }
|
||||
dl.constants .note { padding: 2px 6px; padding-right: 12px; margin-top: 6px; }
|
||||
dl.constants .docstring { margin-left: 32px; font-size: 0.9em; font-weight: normal; }
|
||||
dl.constants .tags { padding-left: 32px; font-size: 0.9em; line-height: 0.8em; }
|
||||
dl.constants .discussion *:first-child { margin-top: 0; }
|
||||
dl.constants .discussion *:last-child { margin-bottom: 0; }
|
||||
|
||||
.method_details { border-top: 1px dotted #aaa; margin-top: 15px; padding-top: 0; }
|
||||
.method_details.first { border: 0; }
|
||||
p.signature, h3.signature {
|
||||
font-size: 1.1em; font-weight: normal; font-family: Monaco, Consolas, Courier, monospace;
|
||||
padding: 6px 10px; margin-top: 18px;
|
||||
background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px;
|
||||
}
|
||||
p.signature tt,
|
||||
h3.signature tt { font-family: Monaco, Consolas, Courier, monospace; }
|
||||
p.signature .overload,
|
||||
h3.signature .overload { display: block; }
|
||||
p.signature .extras,
|
||||
h3.signature .extras { font-weight: normal; font-family: sans-serif; color: #444; font-size: 1em; }
|
||||
p.signature .not_defined_here,
|
||||
h3.signature .not_defined_here,
|
||||
p.signature .aliases,
|
||||
h3.signature .aliases { display: block; font-weight: normal; font-size: 0.9em; font-family: sans-serif; margin-top: 0px; color: #555; }
|
||||
p.signature .aliases .names,
|
||||
h3.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace; font-weight: bold; color: #000; font-size: 1.2em; }
|
||||
|
||||
.tags .tag_title { font-size: 1em; margin-bottom: 0; font-weight: bold; }
|
||||
.tags ul { margin-top: 5px; padding-left: 30px; list-style: square; }
|
||||
.tags ul li { margin-bottom: 3px; }
|
||||
.tags ul .name { font-family: monospace; font-weight: bold; }
|
||||
.tags ul .note { padding: 3px 6px; }
|
||||
.tags { margin-bottom: 12px; }
|
||||
|
||||
.tags .examples .tag_title { margin-bottom: 10px; font-weight: bold; }
|
||||
.tags .examples .inline p { padding: 0; margin: 0; margin-left: 15px; font-weight: bold; font-size: 0.9em; }
|
||||
|
||||
.tags .overload .overload_item { list-style: none; margin-bottom: 25px; }
|
||||
.tags .overload .overload_item .signature {
|
||||
padding: 2px 8px;
|
||||
background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px;
|
||||
}
|
||||
.tags .overload .signature { margin-left: -15px; font-family: monospace; display: block; font-size: 1.1em; }
|
||||
.tags .overload .docstring { margin-top: 15px; }
|
||||
|
||||
.defines { display: none; }
|
||||
|
||||
#method_missing_details .notice.this { position: relative; top: -8px; color: #888; padding: 0; margin: 0; }
|
||||
|
||||
.showSource { font-size: 0.9em; }
|
||||
.showSource a:link, .showSource a:visited { text-decoration: none; color: #666; }
|
||||
|
||||
#content a:link, #content a:visited { text-decoration: none; color: #05a; }
|
||||
#content a:hover { background: #ffffa5; }
|
||||
div.docstring, p.docstring { margin-right: 6em; }
|
||||
|
||||
ul.summary {
|
||||
list-style: none;
|
||||
font-family: monospace;
|
||||
font-size: 1em;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
ul.summary a:link, ul.summary a:visited {
|
||||
text-decoration: none; font-size: 1.1em;
|
||||
}
|
||||
ul.summary li { margin-bottom: 5px; }
|
||||
.summary .summary_signature {
|
||||
padding: 1px 10px;
|
||||
background: #eaeaff; border: 1px solid #dfdfe5;
|
||||
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
||||
}
|
||||
.summary_signature:hover { background: #eeeeff; cursor: pointer; }
|
||||
ul.summary.compact li { display: inline-block; margin: 0px 5px 0px 0px; line-height: 2.6em;}
|
||||
ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; }
|
||||
#content .summary_signature:hover a:link,
|
||||
#content .summary_signature:hover a:visited {
|
||||
background: transparent;
|
||||
color: #48f;
|
||||
}
|
||||
|
||||
p.inherited a { font-family: monospace; font-size: 0.9em; }
|
||||
p.inherited { word-spacing: 5px; font-size: 1.2em; }
|
||||
|
||||
p.children { font-size: 1.2em; }
|
||||
p.children a { font-size: 0.9em; }
|
||||
p.children strong { font-size: 0.8em; }
|
||||
p.children strong.modules { padding-left: 5px; }
|
||||
|
||||
ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; }
|
||||
ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; }
|
||||
ul.fullTree li { text-align: center; padding-top: 18px; padding-bottom: 12px; background: url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHtJREFUeNqMzrEJAkEURdGzuhgZbSoYWcAWoBVsB4JgZAGmphsZCZYzTQgWNCYrDN9RvMmHx+X916SUBFbo8CzD1idXrLErw1mQttgXtyrOcQ/Ny5p4Qh+2XqLYYazsPWNTiuMkRxa4vcV+evuNAUOLIx5+c2hyzv7hNQC67Q+/HHmlEwAAAABJRU5ErkJggg==) no-repeat top center; }
|
||||
ul.fullTree li:first-child { padding-top: 0; background: transparent; }
|
||||
ul.fullTree li:last-child { padding-bottom: 0; }
|
||||
.showAll ul.fullTree { display: block; }
|
||||
.showAll .inheritName { display: none; }
|
||||
|
||||
#search { position: absolute; right: 14px; top: 0px; }
|
||||
#search a:link, #search a:visited {
|
||||
display: block; float: left; margin-right: 4px;
|
||||
padding: 8px 10px; text-decoration: none; color: #05a;
|
||||
border: 1px solid #d8d8e5;
|
||||
-moz-border-radius-bottomleft: 3px; -moz-border-radius-bottomright: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px; -webkit-border-bottom-right-radius: 3px;
|
||||
background: #eaf0ff;
|
||||
-webkit-box-shadow: -1px 1px 3px #ddd;
|
||||
}
|
||||
#search a:hover { background: #f5faff; color: #06b; }
|
||||
#search a.active {
|
||||
background: #568; padding-bottom: 20px; color: #fff; border: 1px solid #457;
|
||||
-moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px;
|
||||
-webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px;
|
||||
}
|
||||
#search a.inactive { color: #999; }
|
||||
.frames #search { display: none; }
|
||||
.inheritanceTree, .toggleDefines { float: right; }
|
||||
|
||||
#menu { font-size: 1.3em; color: #bbb; top: -5px; position: relative; }
|
||||
#menu .title, #menu a { font-size: 0.7em; }
|
||||
#menu .title a { font-size: 1em; }
|
||||
#menu .title { color: #555; }
|
||||
#menu a:link, #menu a:visited { color: #333; text-decoration: none; border-bottom: 1px dotted #bbd; }
|
||||
#menu a:hover { color: #05a; }
|
||||
#menu .noframes { display: inline; }
|
||||
.frames #menu .noframes { display: inline; float: right; }
|
||||
|
||||
#footer { margin-top: 15px; border-top: 1px solid #ccc; text-align: center; padding: 7px 0; color: #999; }
|
||||
#footer a:link, #footer a:visited { color: #444; text-decoration: none; border-bottom: 1px dotted #bbd; }
|
||||
#footer a:hover { color: #05a; }
|
||||
|
||||
#listing ul.alpha { font-size: 1.1em; }
|
||||
#listing ul.alpha { margin: 0; padding: 0; padding-bottom: 10px; list-style: none; }
|
||||
#listing ul.alpha li.letter { font-size: 1.4em; padding-bottom: 10px; }
|
||||
#listing ul.alpha ul { margin: 0; padding-left: 15px; }
|
||||
#listing ul small { color: #666; font-size: 0.7em; }
|
||||
|
||||
li.r1 { background: #f0f0f0; }
|
||||
li.r2 { background: #fafafa; }
|
||||
|
||||
#search_frame {
|
||||
z-index: 9999;
|
||||
background: #fff;
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 36px;
|
||||
right: 18px;
|
||||
width: 500px;
|
||||
height: 80%;
|
||||
overflow-y: scroll;
|
||||
border: 1px solid #999;
|
||||
border-collapse: collapse;
|
||||
-webkit-box-shadow: -7px 5px 25px #aaa;
|
||||
-moz-box-shadow: -7px 5px 25px #aaa;
|
||||
-moz-border-radius: 2px;
|
||||
-webkit-border-radius: 2px;
|
||||
}
|
||||
|
||||
#content ul.summary li.deprecated .summary_signature a:link,
|
||||
#content ul.summary li.deprecated .summary_signature a:visited { text-decoration: line-through; font-style: italic; }
|
||||
|
||||
#toc {
|
||||
padding: 20px; padding-right: 30px; border: 1px solid #ddd; float: right; background: #fff; margin-left: 20px; margin-bottom: 20px;
|
||||
max-width: 300px;
|
||||
-webkit-box-shadow: -2px 2px 6px #bbb;
|
||||
-moz-box-shadow: -2px 2px 6px #bbb;
|
||||
z-index: 5000;
|
||||
position: relative;
|
||||
overflow-x: auto;
|
||||
}
|
||||
#toc.nofloat { float: none; max-width: none; border: none; padding: 0; margin: 20px 0; -webkit-box-shadow: none; -moz-box-shadow: none; }
|
||||
#toc.nofloat.hidden { padding: 0; background: 0; margin-bottom: 5px; }
|
||||
#toc .title { margin: 0; }
|
||||
#toc ol { padding-left: 1.8em; }
|
||||
#toc li { font-size: 1.1em; line-height: 1.7em; }
|
||||
#toc > ol > li { font-size: 1.1em; font-weight: bold; }
|
||||
#toc ol > ol { font-size: 0.9em; }
|
||||
#toc ol ol > ol { padding-left: 2.3em; }
|
||||
#toc ol + li { margin-top: 0.3em; }
|
||||
#toc.hidden { padding: 10px; background: #f6f6f6; -webkit-box-shadow: none; -moz-box-shadow: none; }
|
||||
#filecontents h1 + #toc.nofloat { margin-top: 0; }
|
||||
|
||||
/* syntax highlighting */
|
||||
.source_code { display: none; padding: 3px 8px; border-left: 8px solid #ddd; margin-top: 5px; }
|
||||
#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; }
|
||||
#filecontents pre.code, .docstring pre.code { display: block; }
|
||||
.source_code .lines { padding-right: 12px; color: #555; text-align: right; }
|
||||
#filecontents pre.code, .docstring pre.code,
|
||||
.tags pre.example { padding: 5px 12px; margin-top: 4px; border: 1px solid #eef; background: #f5f5ff; }
|
||||
pre.code { color: #000; }
|
||||
pre.code .info.file { color: #555; }
|
||||
pre.code .val { color: #036A07; }
|
||||
pre.code .tstring_content,
|
||||
pre.code .heredoc_beg, pre.code .heredoc_end,
|
||||
pre.code .qwords_beg, pre.code .qwords_end,
|
||||
pre.code .tstring, pre.code .dstring { color: #036A07; }
|
||||
pre.code .fid, pre.code .rubyid_new, pre.code .rubyid_to_s,
|
||||
pre.code .rubyid_to_sym, pre.code .rubyid_to_f,
|
||||
pre.code .dot + pre.code .id,
|
||||
pre.code .rubyid_to_i pre.code .rubyid_each { color: #0085FF; }
|
||||
pre.code .comment { color: #0066FF; }
|
||||
pre.code .const, pre.code .constant { color: #585CF6; }
|
||||
pre.code .label,
|
||||
pre.code .symbol { color: #C5060B; }
|
||||
pre.code .kw,
|
||||
pre.code .rubyid_require,
|
||||
pre.code .rubyid_extend,
|
||||
pre.code .rubyid_include { color: #0000FF; }
|
||||
pre.code .ivar { color: #318495; }
|
||||
pre.code .gvar,
|
||||
pre.code .rubyid_backref,
|
||||
pre.code .rubyid_nth_ref { color: #6D79DE; }
|
||||
pre.code .regexp, .dregexp { color: #036A07; }
|
||||
pre.code a { border-bottom: 1px dotted #bbf; }
|
||||
262
file.README.html
262
file.README.html
@ -1,262 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>
|
||||
File: README
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '';
|
||||
framesUrl = "frames.html#!file.README.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="_index.html">Index</a> »
|
||||
<span class="title">File: README</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><div id='filecontents'>
|
||||
<h1 id="label-ActiveModelSerializers">ActiveModelSerializers</h1>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Build Status</td>
|
||||
<td>
|
||||
<a href="https://travis-ci.org/rails-api/active_model_serializers"><img src="https://travis-ci.org/rails-api/active_model_serializers.svg?branch=master" alt="Build Status" ></a>
|
||||
<a href="https://ci.appveyor.com/project/joaomdmoura/active-model-serializers/branch/master"><img src="https://ci.appveyor.com/api/projects/status/x6xdjydutm54gvyt/branch/master?svg=true" alt="Build status"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Code Quality</td>
|
||||
<td>
|
||||
<a href="https://codeclimate.com/github/rails-api/active_model_serializers"><img src="https://codeclimate.com/github/rails-api/active_model_serializers/badges/gpa.svg" alt="Code Quality"></a>
|
||||
<a href="https://codebeat.co/projects/github-com-rails-api-active_model_serializers"><img src="https://codebeat.co/badges/a9ab35fa-8b5a-4680-9d4e-a81f9a55ebcd" alt="codebeat" ></a>
|
||||
<a href="https://codeclimate.com/github/rails-api/active_model_serializers/coverage"><img src="https://codeclimate.com/github/rails-api/active_model_serializers/badges/coverage.svg" alt="Test Coverage"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Issue Stats</td>
|
||||
<td>
|
||||
<a href="https://github.com/rails-api/active_model_serializers/pulse/monthly">Pulse</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 id="label-About">About</h2>
|
||||
|
||||
<p>ActiveModelSerializers brings convention over configuration to your JSON
|
||||
generation.</p>
|
||||
|
||||
<p>ActiveModelSerializers works through two components:
|
||||
<strong>serializers</strong> and <strong>adapters</strong>.</p>
|
||||
|
||||
<p>Serializers describe <em>which</em> attributes and relationships should be
|
||||
serialized.</p>
|
||||
|
||||
<p>Adapters describe <em>how</em> attributes and relationships should be
|
||||
serialized.</p>
|
||||
|
||||
<p>SerializableResource co-ordinates the resource, Adapter and Serializer to
|
||||
produce the resource serialization. The serialization has the
|
||||
<code>#as_json</code>, <code>#to_json</code> and
|
||||
<code>#serializable_hash</code> methods used by the Rails JSON Renderer.
|
||||
(SerializableResource actually delegates these methods to the adapter.)</p>
|
||||
|
||||
<p>By default ActiveModelSerializers will use the <strong>Attributes
|
||||
Adapter</strong> (no JSON root). But we strongly advise you to use
|
||||
<strong>JsonApi Adapter</strong>, which follows 1.0 of the format specified
|
||||
in <a href="http://jsonapi.org/format">jsonapi.org/format</a>. Check how to
|
||||
change the adapter in the sections below.</p>
|
||||
|
||||
<p><code>0.10.x</code> is <strong>not</strong> backward compatible with
|
||||
<code>0.9.x</code> nor <code>0.8.x</code>.</p>
|
||||
|
||||
<p><code>0.10.x</code> is based on the <code>0.8.0</code> code, but with a
|
||||
more flexible architecture. We'd love your help. <a
|
||||
href="CONTRIBUTING.md">Learn how you can help here.</a></p>
|
||||
|
||||
<p>It is generally safe and recommended to use the master branch.</p>
|
||||
|
||||
<h2 id="label-Installation">Installation</h2>
|
||||
|
||||
<p>Add this line to your application's Gemfile:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>active_model_serializers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>~> 0.10.0</span><span class='tstring_end'>'</span></span>
|
||||
</code></pre>
|
||||
|
||||
<p>And then execute:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">$ bundle</code></pre>
|
||||
|
||||
<h2 id="label-Getting+Started">Getting Started</h2>
|
||||
|
||||
<p>See <a href="docs/general/getting_started.md">Getting Started</a> for the
|
||||
nuts and bolts.</p>
|
||||
|
||||
<p>More information is available in the <a href="docs">Guides</a> and <a
|
||||
href="README.md#high-level-behavior">High-level behavior</a>.</p>
|
||||
|
||||
<h2 id="label-Getting+Help">Getting Help</h2>
|
||||
|
||||
<p>If you find a bug, please report an <a
|
||||
href="https://github.com/rails-api/active_model_serializers/issues/new">Issue</a>
|
||||
and see our <a href="CONTRIBUTING.md">contributing guide</a>.</p>
|
||||
|
||||
<p>If you have a question, please <a
|
||||
href="http://stackoverflow.com/questions/tagged/active-model-serializers">post
|
||||
to Stack Overflow</a>.</p>
|
||||
|
||||
<p>If you'd like to chat, we have a <a
|
||||
href="http://amserializers.herokuapp.com">community slack</a>.</p>
|
||||
|
||||
<p>Thanks!</p>
|
||||
|
||||
<h2 id="label-Documentation">Documentation</h2>
|
||||
<ul><li>
|
||||
<p><a
|
||||
href="https://github.com/rails-api/active_model_serializers/tree/master">0.10
|
||||
(master) Documentation</a></p>
|
||||
</li><li>
|
||||
<p><a
|
||||
href="http://www.rubydoc.info/github/rails-api/active_model_serializers/v0.10.0"><img
|
||||
src="http://img.shields.io/badge/yard-docs-blue.svg"></a></p>
|
||||
</li><li>
|
||||
<p><a href="docs">Guides</a></p>
|
||||
</li><li>
|
||||
<p><a
|
||||
href="https://github.com/rails-api/active_model_serializers/tree/0-9-stable">0.9
|
||||
(0-9-stable) Documentation</a></p>
|
||||
</li><li>
|
||||
<p><a
|
||||
href="http://www.rubydoc.info/github/rails-api/active_model_serializers/0-9-stable"><img
|
||||
src="http://img.shields.io/badge/yard-docs-blue.svg"></a></p>
|
||||
</li><li>
|
||||
<p><a
|
||||
href="https://github.com/rails-api/active_model_serializers/tree/0-8-stable">0.8
|
||||
(0-8-stable) Documentation</a></p>
|
||||
</li><li>
|
||||
<p><a
|
||||
href="http://www.rubydoc.info/github/rails-api/active_model_serializers/0-8-stable"><img
|
||||
src="http://img.shields.io/badge/yard-docs-blue.svg"></a></p>
|
||||
</li></ul>
|
||||
|
||||
<h2 id="label-High-level+behavior">High-level behavior</h2>
|
||||
|
||||
<p>Choose an adapter from <a
|
||||
href="lib/active_model_serializers/adapter">adapters</a>:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='const'>ActiveModelSerializers</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_adapter'>adapter</span> <span class='op'>=</span> <span class='symbol'>:json_api</span> <span class='comment'># Default: `:attributes`
|
||||
</span></code></pre>
|
||||
|
||||
<p>Given a <a href="lib/active_model/serializer/lint.rb">serializable
|
||||
model</a>:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='comment'># either
|
||||
</span><span class='kw'>class</span> <span class='const'>SomeResource</span> <span class='op'><</span> <span class='const'>ActiveRecord</span><span class='op'>::</span><span class='const'>Base</span>
|
||||
<span class='comment'># columns: title, body
|
||||
</span><span class='kw'>end</span>
|
||||
<span class='comment'># or
|
||||
</span><span class='kw'>class</span> <span class='const'>SomeResource</span> <span class='op'><</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Model</span>
|
||||
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:title</span><span class='comma'>,</span> <span class='symbol'>:body</span>
|
||||
<span class='kw'>end</span>
|
||||
</code></pre>
|
||||
|
||||
<p>And initialized as:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_resource'>resource</span> <span class='op'>=</span> <span class='const'>SomeResource</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>title:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ActiveModelSerializers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>body:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Convention over configuration</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
||||
</code></pre>
|
||||
|
||||
<p>Given a serializer for the serializable model:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>SomeSerializer</span> <span class='op'><</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span>
|
||||
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:title</span><span class='comma'>,</span> <span class='label'>key:</span> <span class='symbol'>:name</span>
|
||||
<span class='id identifier rubyid_attributes'>attributes</span> <span class='symbol'>:body</span>
|
||||
<span class='kw'>end</span>
|
||||
</code></pre>
|
||||
|
||||
<p>The model can be serialized as:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_serialization'>serialization</span> <span class='op'>=</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>SerializableResource</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serialization'>serialization</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span>
|
||||
<span class='id identifier rubyid_serialization'>serialization</span><span class='period'>.</span><span class='id identifier rubyid_as_json'>as_json</span>
|
||||
</code></pre>
|
||||
|
||||
<p>SerializableResource delegates to the adapter, which it builds as:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_adapter_options'>adapter_options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_adapter'>adapter</span> <span class='op'>=</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_adapter_options'>adapter_options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span>
|
||||
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_as_json'>as_json</span>
|
||||
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_serializable_hash'>serializable_hash</span>
|
||||
</code></pre>
|
||||
|
||||
<p>The adapter formats the serializer's attributes and associations
|
||||
(a.k.a. includes):</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_serializer_options'>serializer_options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span> <span class='op'>=</span> <span class='const'>SomeSerializer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_serializer_options'>serializer_options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_associations'>associations</span>
|
||||
</code></pre>
|
||||
|
||||
<p>See <a href="docs/ARCHITECTURE.md">ARCHITECTURE.md</a> for more
|
||||
information.</p>
|
||||
|
||||
<h2 id="label-Contributing">Contributing</h2>
|
||||
|
||||
<p>See <a href="CONTRIBUTING.md">CONTRIBUTING.md</a></p>
|
||||
</div></div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:35 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,60 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
||||
|
||||
|
||||
<title>File List</title>
|
||||
<base id="base_target" target="_parent" />
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
var hasFrames = false;
|
||||
try {
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
} catch (e) { }
|
||||
if (hasFrames) {
|
||||
document.getElementById('base_target').target = 'main';
|
||||
document.body.className = 'frames';
|
||||
}
|
||||
</script>
|
||||
<div id="content">
|
||||
<h1 id="full_list_header">File List</h1>
|
||||
<div id="nav">
|
||||
|
||||
<span><a target="_self" href="class_list.html">
|
||||
Classes
|
||||
</a></span>
|
||||
|
||||
<span><a target="_self" href="method_list.html">
|
||||
Methods
|
||||
</a></span>
|
||||
|
||||
<span><a target="_self" href="file_list.html">
|
||||
Files
|
||||
</a></span>
|
||||
|
||||
</div>
|
||||
<div id="search">Search: <input type="text" /></div>
|
||||
|
||||
<ul id="full_list" class="file">
|
||||
|
||||
|
||||
<li class="r1"><span class="object_link"><a href="index.html" title="README">README</a></a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
26
frames.html
26
frames.html
@ -1,26 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.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>Documentation by YARD 0.8.7.6</title>
|
||||
</head>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
window.onload = function() {
|
||||
var match = unescape(window.location.hash).match(/^#!(.+)/);
|
||||
var name = match ? match[1] : 'index.html';
|
||||
name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
|
||||
document.writeln('<frameset cols="20%,*">' +
|
||||
'<frame name="list" src="class_list.html" />' +
|
||||
'<frame name="main" src="' + escape(name) + '" />' +
|
||||
'</frameset>');
|
||||
}
|
||||
</script>
|
||||
<noscript>
|
||||
<frameset cols="20%,*">
|
||||
<frame name="list" src="class_list.html" />
|
||||
<frame name="main" src="index.html" />
|
||||
</frameset>
|
||||
</noscript>
|
||||
</html>
|
||||
262
index.html
262
index.html
@ -1,262 +0,0 @@
|
||||
<!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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>
|
||||
File: README
|
||||
|
||||
— Documentation by YARD 0.8.7.6
|
||||
|
||||
</title>
|
||||
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
hasFrames = window.top.frames.main ? true : false;
|
||||
relpath = '';
|
||||
framesUrl = "frames.html#!file.README.html";
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="menu">
|
||||
|
||||
<a href="_index.html">Index</a> »
|
||||
<span class="title">File: README</span>
|
||||
|
||||
|
||||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
|
||||
<a class="full_list_link" id="class_list_link"
|
||||
href="class_list.html">
|
||||
Class List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="method_list_link"
|
||||
href="method_list.html">
|
||||
Method List
|
||||
</a>
|
||||
|
||||
<a class="full_list_link" id="file_list_link"
|
||||
href="file_list.html">
|
||||
File List
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<iframe id="search_frame"></iframe>
|
||||
|
||||
<div id="content"><div id='filecontents'>
|
||||
<h1 id="label-ActiveModelSerializers">ActiveModelSerializers</h1>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Build Status</td>
|
||||
<td>
|
||||
<a href="https://travis-ci.org/rails-api/active_model_serializers"><img src="https://travis-ci.org/rails-api/active_model_serializers.svg?branch=master" alt="Build Status" ></a>
|
||||
<a href="https://ci.appveyor.com/project/joaomdmoura/active-model-serializers/branch/master"><img src="https://ci.appveyor.com/api/projects/status/x6xdjydutm54gvyt/branch/master?svg=true" alt="Build status"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Code Quality</td>
|
||||
<td>
|
||||
<a href="https://codeclimate.com/github/rails-api/active_model_serializers"><img src="https://codeclimate.com/github/rails-api/active_model_serializers/badges/gpa.svg" alt="Code Quality"></a>
|
||||
<a href="https://codebeat.co/projects/github-com-rails-api-active_model_serializers"><img src="https://codebeat.co/badges/a9ab35fa-8b5a-4680-9d4e-a81f9a55ebcd" alt="codebeat" ></a>
|
||||
<a href="https://codeclimate.com/github/rails-api/active_model_serializers/coverage"><img src="https://codeclimate.com/github/rails-api/active_model_serializers/badges/coverage.svg" alt="Test Coverage"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Issue Stats</td>
|
||||
<td>
|
||||
<a href="https://github.com/rails-api/active_model_serializers/pulse/monthly">Pulse</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 id="label-About">About</h2>
|
||||
|
||||
<p>ActiveModelSerializers brings convention over configuration to your JSON
|
||||
generation.</p>
|
||||
|
||||
<p>ActiveModelSerializers works through two components:
|
||||
<strong>serializers</strong> and <strong>adapters</strong>.</p>
|
||||
|
||||
<p>Serializers describe <em>which</em> attributes and relationships should be
|
||||
serialized.</p>
|
||||
|
||||
<p>Adapters describe <em>how</em> attributes and relationships should be
|
||||
serialized.</p>
|
||||
|
||||
<p>SerializableResource co-ordinates the resource, Adapter and Serializer to
|
||||
produce the resource serialization. The serialization has the
|
||||
<code>#as_json</code>, <code>#to_json</code> and
|
||||
<code>#serializable_hash</code> methods used by the Rails JSON Renderer.
|
||||
(SerializableResource actually delegates these methods to the adapter.)</p>
|
||||
|
||||
<p>By default ActiveModelSerializers will use the <strong>Attributes
|
||||
Adapter</strong> (no JSON root). But we strongly advise you to use
|
||||
<strong>JsonApi Adapter</strong>, which follows 1.0 of the format specified
|
||||
in <a href="http://jsonapi.org/format">jsonapi.org/format</a>. Check how to
|
||||
change the adapter in the sections below.</p>
|
||||
|
||||
<p><code>0.10.x</code> is <strong>not</strong> backward compatible with
|
||||
<code>0.9.x</code> nor <code>0.8.x</code>.</p>
|
||||
|
||||
<p><code>0.10.x</code> is based on the <code>0.8.0</code> code, but with a
|
||||
more flexible architecture. We'd love your help. <a
|
||||
href="CONTRIBUTING.md">Learn how you can help here.</a></p>
|
||||
|
||||
<p>It is generally safe and recommended to use the master branch.</p>
|
||||
|
||||
<h2 id="label-Installation">Installation</h2>
|
||||
|
||||
<p>Add this line to your application's Gemfile:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>active_model_serializers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>~> 0.10.0</span><span class='tstring_end'>'</span></span>
|
||||
</code></pre>
|
||||
|
||||
<p>And then execute:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby">$ bundle</code></pre>
|
||||
|
||||
<h2 id="label-Getting+Started">Getting Started</h2>
|
||||
|
||||
<p>See <a href="docs/general/getting_started.md">Getting Started</a> for the
|
||||
nuts and bolts.</p>
|
||||
|
||||
<p>More information is available in the <a href="docs">Guides</a> and <a
|
||||
href="README.md#high-level-behavior">High-level behavior</a>.</p>
|
||||
|
||||
<h2 id="label-Getting+Help">Getting Help</h2>
|
||||
|
||||
<p>If you find a bug, please report an <a
|
||||
href="https://github.com/rails-api/active_model_serializers/issues/new">Issue</a>
|
||||
and see our <a href="CONTRIBUTING.md">contributing guide</a>.</p>
|
||||
|
||||
<p>If you have a question, please <a
|
||||
href="http://stackoverflow.com/questions/tagged/active-model-serializers">post
|
||||
to Stack Overflow</a>.</p>
|
||||
|
||||
<p>If you'd like to chat, we have a <a
|
||||
href="http://amserializers.herokuapp.com">community slack</a>.</p>
|
||||
|
||||
<p>Thanks!</p>
|
||||
|
||||
<h2 id="label-Documentation">Documentation</h2>
|
||||
<ul><li>
|
||||
<p><a
|
||||
href="https://github.com/rails-api/active_model_serializers/tree/master">0.10
|
||||
(master) Documentation</a></p>
|
||||
</li><li>
|
||||
<p><a
|
||||
href="http://www.rubydoc.info/github/rails-api/active_model_serializers/v0.10.0"><img
|
||||
src="http://img.shields.io/badge/yard-docs-blue.svg"></a></p>
|
||||
</li><li>
|
||||
<p><a href="docs">Guides</a></p>
|
||||
</li><li>
|
||||
<p><a
|
||||
href="https://github.com/rails-api/active_model_serializers/tree/0-9-stable">0.9
|
||||
(0-9-stable) Documentation</a></p>
|
||||
</li><li>
|
||||
<p><a
|
||||
href="http://www.rubydoc.info/github/rails-api/active_model_serializers/0-9-stable"><img
|
||||
src="http://img.shields.io/badge/yard-docs-blue.svg"></a></p>
|
||||
</li><li>
|
||||
<p><a
|
||||
href="https://github.com/rails-api/active_model_serializers/tree/0-8-stable">0.8
|
||||
(0-8-stable) Documentation</a></p>
|
||||
</li><li>
|
||||
<p><a
|
||||
href="http://www.rubydoc.info/github/rails-api/active_model_serializers/0-8-stable"><img
|
||||
src="http://img.shields.io/badge/yard-docs-blue.svg"></a></p>
|
||||
</li></ul>
|
||||
|
||||
<h2 id="label-High-level+behavior">High-level behavior</h2>
|
||||
|
||||
<p>Choose an adapter from <a
|
||||
href="lib/active_model_serializers/adapter">adapters</a>:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='const'>ActiveModelSerializers</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_adapter'>adapter</span> <span class='op'>=</span> <span class='symbol'>:json_api</span> <span class='comment'># Default: `:attributes`
|
||||
</span></code></pre>
|
||||
|
||||
<p>Given a <a href="lib/active_model/serializer/lint.rb">serializable
|
||||
model</a>:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='comment'># either
|
||||
</span><span class='kw'>class</span> <span class='const'>SomeResource</span> <span class='op'><</span> <span class='const'>ActiveRecord</span><span class='op'>::</span><span class='const'>Base</span>
|
||||
<span class='comment'># columns: title, body
|
||||
</span><span class='kw'>end</span>
|
||||
<span class='comment'># or
|
||||
</span><span class='kw'>class</span> <span class='const'>SomeResource</span> <span class='op'><</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Model</span>
|
||||
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:title</span><span class='comma'>,</span> <span class='symbol'>:body</span>
|
||||
<span class='kw'>end</span>
|
||||
</code></pre>
|
||||
|
||||
<p>And initialized as:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_resource'>resource</span> <span class='op'>=</span> <span class='const'>SomeResource</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>title:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ActiveModelSerializers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>body:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Convention over configuration</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
||||
</code></pre>
|
||||
|
||||
<p>Given a serializer for the serializable model:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>SomeSerializer</span> <span class='op'><</span> <span class='const'>ActiveModel</span><span class='op'>::</span><span class='const'>Serializer</span>
|
||||
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:title</span><span class='comma'>,</span> <span class='label'>key:</span> <span class='symbol'>:name</span>
|
||||
<span class='id identifier rubyid_attributes'>attributes</span> <span class='symbol'>:body</span>
|
||||
<span class='kw'>end</span>
|
||||
</code></pre>
|
||||
|
||||
<p>The model can be serialized as:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_serialization'>serialization</span> <span class='op'>=</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>SerializableResource</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serialization'>serialization</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span>
|
||||
<span class='id identifier rubyid_serialization'>serialization</span><span class='period'>.</span><span class='id identifier rubyid_as_json'>as_json</span>
|
||||
</code></pre>
|
||||
|
||||
<p>SerializableResource delegates to the adapter, which it builds as:</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_adapter_options'>adapter_options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_adapter'>adapter</span> <span class='op'>=</span> <span class='const'>ActiveModelSerializers</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_serializer'>serializer</span><span class='comma'>,</span> <span class='id identifier rubyid_adapter_options'>adapter_options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span>
|
||||
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_as_json'>as_json</span>
|
||||
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_serializable_hash'>serializable_hash</span>
|
||||
</code></pre>
|
||||
|
||||
<p>The adapter formats the serializer's attributes and associations
|
||||
(a.k.a. includes):</p>
|
||||
|
||||
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_serializer_options'>serializer_options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span> <span class='op'>=</span> <span class='const'>SomeSerializer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_serializer_options'>serializer_options</span><span class='rparen'>)</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span>
|
||||
<span class='id identifier rubyid_serializer'>serializer</span><span class='period'>.</span><span class='id identifier rubyid_associations'>associations</span>
|
||||
</code></pre>
|
||||
|
||||
<p>See <a href="docs/ARCHITECTURE.md">ARCHITECTURE.md</a> for more
|
||||
information.</p>
|
||||
|
||||
<h2 id="label-Contributing">Contributing</h2>
|
||||
|
||||
<p>See <a href="CONTRIBUTING.md">CONTRIBUTING.md</a></p>
|
||||
</div></div>
|
||||
|
||||
<div id="footer">
|
||||
Generated on Mon Jun 13 21:53:35 2016 by
|
||||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||||
0.8.7.6 (ruby-2.2.4).
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user