483 lines
No EOL
13 KiB
HTML
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
|
|
|
|
— 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> »
|
|
<span class='title'><span class='object_link'><a href="../Diaspora.html" title="Diaspora (module)">Diaspora</a></span></span>
|
|
»
|
|
<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'>""</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'>></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'>"<link href=\"\#{AppConfig[:pubsub_server]}\" rel=\"hub\"/>\n<link href=\"\#{@user.public_url}.atom\" rel=\"self\" type=\"application/atom+xml\"/>\n"</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'>"</feed>\n"</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'>"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<feed xml:lang=\"en-US\" xmlns=\"http://www.w3.org/2005/Atom\" xmlns:thr=\"http://purl.org/syndication/thread/1.0\" xmlns:georss=\"http://www.georss.org/georss\" xmlns:activity=\"http://activitystrea.ms/spec/1.0/\" xmlns:media=\"http://purl.org/syndication/atommedia\" xmlns:poco=\"http://portablecontacts.net/spec/1.0\" xmlns:ostatus=\"http://ostatus.org/schema/1.0\" xmlns:statusnet=\"http://status.net/schema/api/1/\">\n<generator uri=\"\#{AppConfig[:pod_url]}\">Diaspora</generator>\n<id>\#{@user.public_url}.atom</id>\n<title>\#{x(@user.name)}'s Public Feed</title>\n<subtitle>Updates from \#{x(@user.name)} on Diaspora</subtitle>\n<logo>\#{@user.person.profile.image_url(:thumb_small)}</logo>\n<updated>\#{Time.now.xmlschema}</updated>\n"</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'>"<author>\n<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>\n<name>\#{x(@user.name)}</name>\n<uri>\#{AppConfig[:pod_url]}people/\#{@user.person.id}</uri>\n<link rel=\"alternate\" type=\"text/html\" href=\"\#{@user.public_url}\" />\n<poco:preferredUsername>\#{x(@user.username)}</poco:preferredUsername>\n<poco:displayName>\#{x(@user.person.name)}</poco:displayName>\n<link rel=\"avatar\" type=\"image/jpeg\" media:width=\"100\" media:height=\"100\" href=\"\#{@user.profile.image_url}\"/>\n</author>\n"</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> |