diaspora/doc/Diaspora/OstatusBuilder.html
2011-06-13 16:12:32 -07:00

483 lines
No EOL
13 KiB
HTML

<!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: Diaspora::OstatusBuilder
&mdash; Documentation by YARD 0.7.1
</title>
<link rel="stylesheet" href="../css/style.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">
relpath = '..';
if (relpath != '') relpath += '/';
</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>
<script type="text/javascript" charset="utf-8">
if (window.top.frames.main) document.body.className = 'frames';
</script>
<div id="header">
<div id="menu">
<a href="../_index.html">Index (O)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Diaspora.html" title="Diaspora (module)">Diaspora</a></span></span>
&raquo;
<span class="title">OstatusBuilder</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 id="class_list_link" href="#">Class List</a>
<a id="method_list_link" href="#">Method List</a>
<a id="file_list_link" href="#">File List</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><h1>Class: Diaspora::OstatusBuilder
</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">Diaspora::OstatusBuilder</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
<dt class="r2">Includes:</dt>
<dd class="r2"><span class='object_link'><a href="Webhooks.html" title="Diaspora::Webhooks (module)">Webhooks</a></span></dd>
<dt class="r1 last">Defined in:</dt>
<dd class="r1 last">lib/diaspora/ostatus_builder.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_body-instance_method" title="#create_body (instance method)">- (Object) <strong>create_body</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_endpoints-instance_method" title="#create_endpoints (instance method)">- (Object) <strong>create_endpoints</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_footer-instance_method" title="#create_footer (instance method)">- (Object) <strong>create_footer</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_headers-instance_method" title="#create_headers (instance method)">- (Object) <strong>create_headers</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_subject-instance_method" title="#create_subject (instance method)">- (Object) <strong>create_subject</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)">- (OstatusBuilder) <strong>initialize</strong>(user, posts) </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'><p>
A new instance of OstatusBuilder.
</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods included from <span class='object_link'><a href="Webhooks.html" title="Diaspora::Webhooks (module)">Webhooks</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Webhooks.html#receive-instance_method" title="Diaspora::Webhooks#receive (method)">#receive</a></span>, <span class='object_link'><a href="Webhooks.html#subscribers-instance_method" title="Diaspora::Webhooks#subscribers (method)">#subscribers</a></span>, <span class='object_link'><a href="Webhooks.html#to_diaspora_xml-instance_method" title="Diaspora::Webhooks#to_diaspora_xml (method)">#to_diaspora_xml</a></span>, <span class='object_link'><a href="Webhooks.html#x-instance_method" title="Diaspora::Webhooks#x (method)">#x</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<p class="signature first" id="initialize-instance_method">
- (<tt><span class='object_link'><a href="" title="Diaspora::OstatusBuilder (class)">OstatusBuilder</a></span></tt>) <strong>initialize</strong>(user, posts)
</p><div class="docstring">
<div class="discussion">
<p>
A new instance of OstatusBuilder
</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
24
25
26
27</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/diaspora/ostatus_builder.rb', line 24</span>
<span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='user identifier id'>user</span><span class='comma token'>,</span> <span class='posts identifier id'>posts</span><span class='rparen token'>)</span>
<span class='@user ivar id'>@user</span> <span class='assign token'>=</span> <span class='user identifier id'>user</span>
<span class='@posts ivar id'>@posts</span> <span class='assign token'>=</span> <span class='posts identifier id'>posts</span>
<span class='end end 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">
<p class="signature first" id="create_body-instance_method">
- (<tt>Object</tt>) <strong>create_body</strong>
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
66
67
68
69
70
71
72
73
74</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/diaspora/ostatus_builder.rb', line 66</span>
<span class='def def kw'>def</span> <span class='create_body identifier id'>create_body</span>
<span class='@posts ivar id'>@posts</span><span class='dot token'>.</span><span class='inject identifier id'>inject</span><span class='lparen token'>(</span><span class='string val'>&quot;&quot;</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='xml identifier id'>xml</span><span class='comma token'>,</span><span class='curr identifier id'>curr</span><span class='bitor op'>|</span>
<span class='if if kw'>if</span> <span class='curr identifier id'>curr</span><span class='dot token'>.</span><span class='respond_to? fid id'>respond_to?</span><span class='lparen token'>(</span><span class='symbol val'>:to_activity</span><span class='rparen token'>)</span>
<span class='xml identifier id'>xml</span> <span class='plus op'>+</span> <span class='curr identifier id'>curr</span><span class='dot token'>.</span><span class='to_activity identifier id'>to_activity</span><span class='lparen token'>(</span><span class='symbol val'>:author</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='@user ivar id'>@user</span><span class='dot token'>.</span><span class='person identifier id'>person</span><span class='rparen token'>)</span>
<span class='else else kw'>else</span>
<span class='xml identifier id'>xml</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="create_endpoints-instance_method">
- (<tt>Object</tt>) <strong>create_endpoints</strong>
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
58
59
60</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/diaspora/ostatus_builder.rb', line 58</span>
<span class='def def kw'>def</span> <span class='create_endpoints identifier id'>create_endpoints</span>
<span class='string val'>&quot;&lt;link href=\&quot;\#{AppConfig[:pubsub_server]}\&quot; rel=\&quot;hub\&quot;/&gt;\n&lt;link href=\&quot;\#{@user.public_url}.atom\&quot; rel=\&quot;self\&quot; type=\&quot;application/atom+xml\&quot;/&gt;\n&quot;</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="create_footer-instance_method">
- (<tt>Object</tt>) <strong>create_footer</strong>
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
76
77
78</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/diaspora/ostatus_builder.rb', line 76</span>
<span class='def def kw'>def</span> <span class='create_footer identifier id'>create_footer</span>
<span class='string val'>&quot;&lt;/feed&gt;\n&quot;</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="create_headers-instance_method">
- (<tt>Object</tt>) <strong>create_headers</strong>
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
29
30
31</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/diaspora/ostatus_builder.rb', line 29</span>
<span class='def def kw'>def</span> <span class='create_headers identifier id'>create_headers</span>
<span class='string val'>&quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;\n&lt;feed xml:lang=\&quot;en-US\&quot; xmlns=\&quot;http://www.w3.org/2005/Atom\&quot; xmlns:thr=\&quot;http://purl.org/syndication/thread/1.0\&quot; xmlns:georss=\&quot;http://www.georss.org/georss\&quot; xmlns:activity=\&quot;http://activitystrea.ms/spec/1.0/\&quot; xmlns:media=\&quot;http://purl.org/syndication/atommedia\&quot; xmlns:poco=\&quot;http://portablecontacts.net/spec/1.0\&quot; xmlns:ostatus=\&quot;http://ostatus.org/schema/1.0\&quot; xmlns:statusnet=\&quot;http://status.net/schema/api/1/\&quot;&gt;\n&lt;generator uri=\&quot;\#{AppConfig[:pod_url]}\&quot;&gt;Diaspora&lt;/generator&gt;\n&lt;id&gt;\#{@user.public_url}.atom&lt;/id&gt;\n&lt;title&gt;\#{x(@user.name)}'s Public Feed&lt;/title&gt;\n&lt;subtitle&gt;Updates from \#{x(@user.name)} on Diaspora&lt;/subtitle&gt;\n&lt;logo&gt;\#{@user.person.profile.image_url(:thumb_small)}&lt;/logo&gt;\n&lt;updated&gt;\#{Time.now.xmlschema}&lt;/updated&gt;\n&quot;</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="create_subject-instance_method">
- (<tt>Object</tt>) <strong>create_subject</strong>
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
43
44
45</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/diaspora/ostatus_builder.rb', line 43</span>
<span class='def def kw'>def</span> <span class='create_subject identifier id'>create_subject</span>
<span class='string val'>&quot;&lt;author&gt;\n&lt;activity:object-type&gt;http://activitystrea.ms/schema/1.0/person&lt;/activity:object-type&gt;\n&lt;name&gt;\#{x(@user.name)}&lt;/name&gt;\n&lt;uri&gt;\#{AppConfig[:pod_url]}people/\#{@user.person.id}&lt;/uri&gt;\n&lt;link rel=\&quot;alternate\&quot; type=\&quot;text/html\&quot; href=\&quot;\#{@user.public_url}\&quot; /&gt;\n&lt;poco:preferredUsername&gt;\#{x(@user.username)}&lt;/poco:preferredUsername&gt;\n&lt;poco:displayName&gt;\#{x(@user.person.name)}&lt;/poco:displayName&gt;\n&lt;link rel=\&quot;avatar\&quot; type=\&quot;image/jpeg\&quot; media:width=\&quot;100\&quot; media:height=\&quot;100\&quot; href=\&quot;\#{@user.profile.image_url}\&quot;/&gt;\n&lt;/author&gt;\n&quot;</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Jun 13 15:59:18 2011 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.7.1 (ruby-1.8.7).
</div>
</body>
</html>