atom-tools 0.9.0 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/COPYING +3 -3
- data/README +9 -49
- data/Rakefile +65 -62
- data/bin/atom-cp +159 -0
- data/bin/atom-grep +78 -0
- data/bin/atom-post +73 -0
- data/bin/atom-purge +82 -0
- data/doc/classes/Atom/AttrEl.html +163 -0
- data/doc/classes/Atom/Author.html +2 -19
- data/doc/classes/Atom/AutodiscoveryFailure.html +111 -0
- data/doc/classes/Atom/Categories.html +168 -0
- data/doc/classes/Atom/Category.html +10 -1
- data/doc/classes/Atom/Collection.html +194 -91
- data/doc/classes/Atom/Content.html +42 -1
- data/doc/classes/Atom/Contributor.html +2 -8
- data/doc/classes/Atom/Control.html +126 -0
- data/doc/classes/Atom/Converters.html +571 -0
- data/doc/classes/Atom/DigestAuth.html +285 -0
- data/doc/classes/Atom/Element.html +673 -106
- data/doc/classes/Atom/FileCache.html +287 -0
- data/doc/classes/Atom/HTTP.html +211 -95
- data/doc/classes/Atom/HTTPResponse.html +190 -0
- data/doc/classes/Atom/HasCategories.html +187 -0
- data/doc/classes/Atom/HasLinks.html +168 -0
- data/doc/classes/Atom/Link.html +80 -3
- data/doc/classes/Atom/NilCache.html +202 -0
- data/doc/classes/Atom/ParseError.html +111 -0
- data/doc/classes/Atom/Parsers.html +311 -0
- data/doc/classes/Atom/Person.html +130 -0
- data/doc/classes/Atom/Rights.html +113 -0
- data/doc/classes/Atom/Service.html +298 -0
- data/doc/{files/lib/atom/yaml_rb.html → classes/Atom/Source.html} +26 -24
- data/doc/classes/Atom/Subtitle.html +113 -0
- data/doc/classes/Atom/Summary.html +113 -0
- data/doc/classes/Atom/Text.html +196 -53
- data/doc/classes/Atom/Title.html +113 -0
- data/doc/classes/Atom/Tools.html +525 -0
- data/doc/classes/Atom/Workspace.html +121 -0
- data/doc/classes/Object.html +204 -0
- data/doc/created.rid +1 -1
- data/doc/files/README.html +9 -49
- data/doc/files/lib/atom/cache_rb.html +302 -0
- data/doc/files/lib/atom/collection_rb.html +1 -2
- data/doc/files/lib/atom/element_rb.html +2 -1
- data/doc/files/lib/atom/entry_rb.html +2 -2
- data/doc/files/lib/atom/feed_rb.html +1 -2
- data/doc/files/lib/atom/http_rb.html +6 -1
- data/doc/files/lib/atom/{xml_rb.html → service_rb.html} +8 -6
- data/doc/files/lib/atom/text_rb.html +2 -1
- data/doc/files/lib/atom/{app_rb.html → tools_rb.html} +4 -6
- data/doc/fr_class_index.html +23 -3
- data/doc/fr_file_index.html +3 -3
- data/doc/fr_method_index.html +111 -36
- data/lib/atom/cache.rb +178 -0
- data/lib/atom/collection.rb +90 -40
- data/lib/atom/element.rb +569 -161
- data/lib/atom/entry.rb +63 -89
- data/lib/atom/feed.rb +65 -67
- data/lib/atom/http.rb +421 -49
- data/lib/atom/service.rb +106 -0
- data/lib/atom/text.rb +138 -61
- data/lib/atom/tools.rb +163 -0
- data/spec/entry_spec.rb +364 -0
- data/spec/ext_spec.rb +42 -0
- data/spec/feed_spec.rb +39 -0
- data/spec/fixtures/contacts-feed.xml +34 -0
- data/spec/fixtures/entry-w-ext.xml +15 -0
- data/spec/fixtures/entry-w-xml.xml +24 -0
- data/spec/fixtures/entry.xml +42 -0
- data/spec/fixtures/feed-w-ext.xml +33 -0
- data/spec/fixtures/service-w-xhtml-ns.xml +21 -0
- data/spec/fixtures/service.xml +36 -0
- data/spec/service_spec.rb +108 -0
- data/spec/spec_helper.rb +9 -0
- data/test/conformance/order.rb +11 -10
- data/test/conformance/title.rb +9 -9
- data/test/conformance/updated.rb +2 -1
- data/test/runtests.rb +0 -0
- data/test/test_constructs.rb +78 -8
- data/test/test_feed.rb +35 -29
- data/test/test_general.rb +3 -30
- data/test/test_http.rb +248 -34
- data/test/test_protocol.rb +143 -24
- data/test/test_xml.rb +145 -53
- metadata +116 -62
- data/bin/atom-client.rb +0 -246
- data/bin/atom-server.rb~ +0 -71
- data/doc/classes/Atom/App.html +0 -217
- data/doc/classes/Atom/Entry.html +0 -365
- data/doc/classes/Atom/Feed.html +0 -585
- data/lib/atom/app.rb +0 -87
- data/lib/atom/xml.rb +0 -200
- data/lib/atom/yaml.rb +0 -101
data/doc/classes/Atom/Entry.html
DELETED
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
-
<!DOCTYPE html
|
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
-
|
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
-
<head>
|
|
8
|
-
<title>Class: Atom::Entry</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
-
<script type="text/javascript">
|
|
13
|
-
// <![CDATA[
|
|
14
|
-
|
|
15
|
-
function popupCode( url ) {
|
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function toggleCode( id ) {
|
|
20
|
-
if ( document.getElementById )
|
|
21
|
-
elem = document.getElementById( id );
|
|
22
|
-
else if ( document.all )
|
|
23
|
-
elem = eval( "document.all." + id );
|
|
24
|
-
else
|
|
25
|
-
return false;
|
|
26
|
-
|
|
27
|
-
elemStyle = elem.style;
|
|
28
|
-
|
|
29
|
-
if ( elemStyle.display != "block" ) {
|
|
30
|
-
elemStyle.display = "block"
|
|
31
|
-
} else {
|
|
32
|
-
elemStyle.display = "none"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Make codeblocks hidden by default
|
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
-
|
|
41
|
-
// ]]>
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
</head>
|
|
45
|
-
<body>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div id="classHeader">
|
|
50
|
-
<table class="header-table">
|
|
51
|
-
<tr class="top-aligned-row">
|
|
52
|
-
<td><strong>Class</strong></td>
|
|
53
|
-
<td class="class-name-in-header">Atom::Entry</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr class="top-aligned-row">
|
|
56
|
-
<td><strong>In:</strong></td>
|
|
57
|
-
<td>
|
|
58
|
-
<a href="../../files/lib/atom/yaml_rb.html">
|
|
59
|
-
lib/atom/yaml.rb
|
|
60
|
-
</a>
|
|
61
|
-
<br />
|
|
62
|
-
<a href="../../files/lib/atom/app_rb.html">
|
|
63
|
-
lib/atom/app.rb
|
|
64
|
-
</a>
|
|
65
|
-
<br />
|
|
66
|
-
<a href="../../files/lib/atom/entry_rb.html">
|
|
67
|
-
lib/atom/entry.rb
|
|
68
|
-
</a>
|
|
69
|
-
<br />
|
|
70
|
-
</td>
|
|
71
|
-
</tr>
|
|
72
|
-
|
|
73
|
-
<tr class="top-aligned-row">
|
|
74
|
-
<td><strong>Parent:</strong></td>
|
|
75
|
-
<td>
|
|
76
|
-
Object
|
|
77
|
-
</td>
|
|
78
|
-
</tr>
|
|
79
|
-
</table>
|
|
80
|
-
</div>
|
|
81
|
-
<!-- banner header -->
|
|
82
|
-
|
|
83
|
-
<div id="bodyContent">
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<div id="contextContent">
|
|
88
|
-
|
|
89
|
-
<div id="description">
|
|
90
|
-
<p>
|
|
91
|
-
An individual entry in a feed. As an <a
|
|
92
|
-
href="Element.html">Atom::Element</a>, it can be manipulated using
|
|
93
|
-
accessors for each of its child elements. You should be able to set them
|
|
94
|
-
using an instance of any class that makes sense
|
|
95
|
-
</p>
|
|
96
|
-
<p>
|
|
97
|
-
Entries have the following children:
|
|
98
|
-
</p>
|
|
99
|
-
<table>
|
|
100
|
-
<tr><td valign="top">id:</td><td>a universally unique IRI which permanently identifies the entry
|
|
101
|
-
|
|
102
|
-
</td></tr>
|
|
103
|
-
<tr><td valign="top">title:</td><td>a human-readable title (<a href="Text.html">Atom::Text</a>)
|
|
104
|
-
|
|
105
|
-
</td></tr>
|
|
106
|
-
<tr><td valign="top">content:</td><td>contains or links to the content of an entry (<a
|
|
107
|
-
href="Content.html">Atom::Content</a>)
|
|
108
|
-
|
|
109
|
-
</td></tr>
|
|
110
|
-
<tr><td valign="top">rights:</td><td>information about rights held in and over an entry (<a
|
|
111
|
-
href="Text.html">Atom::Text</a>)
|
|
112
|
-
|
|
113
|
-
</td></tr>
|
|
114
|
-
<tr><td valign="top">source:</td><td>the source feed’s metadata (unimplemented)
|
|
115
|
-
|
|
116
|
-
</td></tr>
|
|
117
|
-
<tr><td valign="top">published:</td><td>a Time "early in the life cycle of an entry"
|
|
118
|
-
|
|
119
|
-
</td></tr>
|
|
120
|
-
<tr><td valign="top">updated:</td><td>the most recent Time an entry was modified in a way the publisher considers
|
|
121
|
-
significant
|
|
122
|
-
|
|
123
|
-
</td></tr>
|
|
124
|
-
<tr><td valign="top">summary:</td><td>a summary, abstract or excerpt of an entry (<a
|
|
125
|
-
href="Text.html">Atom::Text</a>)
|
|
126
|
-
|
|
127
|
-
</td></tr>
|
|
128
|
-
</table>
|
|
129
|
-
<p>
|
|
130
|
-
There are also <tt>categories</tt>, <tt>links</tt>, <tt>authors</tt> and
|
|
131
|
-
<tt>contributors</tt>, each of which is an Array of its respective type and
|
|
132
|
-
can be used thusly:
|
|
133
|
-
</p>
|
|
134
|
-
<pre>
|
|
135
|
-
author = entry.authors.new
|
|
136
|
-
author.name = "Captain Kangaroo"
|
|
137
|
-
</pre>
|
|
138
|
-
|
|
139
|
-
</div>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
</div>
|
|
143
|
-
|
|
144
|
-
<div id="method-list">
|
|
145
|
-
<h3 class="section-bar">Methods</h3>
|
|
146
|
-
|
|
147
|
-
<div class="name-list">
|
|
148
|
-
<a href="#M000002">edit_url</a>
|
|
149
|
-
<a href="#M000001">from_yaml</a>
|
|
150
|
-
<a href="#M000003">parse</a>
|
|
151
|
-
<a href="#M000005">tag_with</a>
|
|
152
|
-
<a href="#M000004">updated!</a>
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
155
|
-
|
|
156
|
-
</div>
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
<!-- if includes -->
|
|
160
|
-
|
|
161
|
-
<div id="section">
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<!-- if method_list -->
|
|
171
|
-
<div id="methods">
|
|
172
|
-
<h3 class="section-bar">Public Class methods</h3>
|
|
173
|
-
|
|
174
|
-
<div id="method-M000001" class="method-detail">
|
|
175
|
-
<a name="M000001"></a>
|
|
176
|
-
|
|
177
|
-
<div class="method-heading">
|
|
178
|
-
<a href="#M000001" class="method-signature">
|
|
179
|
-
<span class="method-name">from_yaml</span><span class="method-args">(yaml)</span>
|
|
180
|
-
</a>
|
|
181
|
-
</div>
|
|
182
|
-
|
|
183
|
-
<div class="method-description">
|
|
184
|
-
<p>
|
|
185
|
-
parses an <a href="Entry.html">Atom::Entry</a> from YAML
|
|
186
|
-
</p>
|
|
187
|
-
<p><a class="source-toggle" href="#"
|
|
188
|
-
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
|
189
|
-
<div class="method-source-code" id="M000001-source">
|
|
190
|
-
<pre>
|
|
191
|
-
<span class="ruby-comment cmt"># File lib/atom/yaml.rb, line 67</span>
|
|
192
|
-
67: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">from_yaml</span> <span class="ruby-identifier">yaml</span>
|
|
193
|
-
68: <span class="ruby-identifier">hash</span> = <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">yaml</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Hash</span>); <span class="ruby-identifier">yaml</span> <span class="ruby-keyword kw">else</span> <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">yaml</span>); <span class="ruby-keyword kw">end</span>
|
|
194
|
-
69:
|
|
195
|
-
70: <span class="ruby-identifier">entry</span> = <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">Entry</span>.<span class="ruby-identifier">new</span>
|
|
196
|
-
71:
|
|
197
|
-
72: <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">title</span> = <span class="ruby-identifier">hash</span>[<span class="ruby-value str">"title"</span>]
|
|
198
|
-
73: <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">summary</span> = <span class="ruby-identifier">hash</span>[<span class="ruby-value str">"summary"</span>]
|
|
199
|
-
74:
|
|
200
|
-
75: <span class="ruby-identifier">elem_constructs</span> = {<span class="ruby-value str">"authors"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">authors</span>, <span class="ruby-value str">"contributors"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">contributors</span>, <span class="ruby-value str">"links"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">links</span>, <span class="ruby-value str">"categories"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">categories</span>}
|
|
201
|
-
76:
|
|
202
|
-
77: <span class="ruby-identifier">elem_constructs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">type</span>,<span class="ruby-identifier">ary</span><span class="ruby-operator">|</span>
|
|
203
|
-
78: <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">type</span>] <span class="ruby-operator">||=</span> []
|
|
204
|
-
79:
|
|
205
|
-
80: <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">type</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">yelem</span><span class="ruby-operator">|</span>
|
|
206
|
-
81: <span class="ruby-identifier">elem</span> = <span class="ruby-identifier">ary</span>.<span class="ruby-identifier">new</span>
|
|
207
|
-
82:
|
|
208
|
-
83: <span class="ruby-identifier">elem</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attrb</span>,<span class="ruby-identifier">req</span><span class="ruby-operator">|</span>
|
|
209
|
-
84: <span class="ruby-identifier">elem</span>[<span class="ruby-identifier">attrb</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">yelem</span>[<span class="ruby-identifier">attrb</span>.<span class="ruby-identifier">to_s</span>]
|
|
210
|
-
85: <span class="ruby-keyword kw">end</span>
|
|
211
|
-
86:
|
|
212
|
-
87: <span class="ruby-identifier">elem</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">elements</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>,<span class="ruby-identifier">kind</span>,<span class="ruby-identifier">req</span><span class="ruby-operator">|</span>
|
|
213
|
-
88: <span class="ruby-identifier">elem</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">"#{name}="</span>.<span class="ruby-identifier">to_sym</span>, <span class="ruby-identifier">yelem</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>])
|
|
214
|
-
89: <span class="ruby-keyword kw">end</span>
|
|
215
|
-
90: <span class="ruby-keyword kw">end</span>
|
|
216
|
-
91: <span class="ruby-keyword kw">end</span>
|
|
217
|
-
92:
|
|
218
|
-
93: <span class="ruby-comment cmt"># this adds more categories, and could cause conflicts</span>
|
|
219
|
-
94: <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">tag_with</span> <span class="ruby-identifier">hash</span>[<span class="ruby-value str">"tags"</span>]
|
|
220
|
-
95: <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">content</span> = <span class="ruby-identifier">hash</span>[<span class="ruby-value str">"content"</span>]
|
|
221
|
-
96: <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">content</span>[<span class="ruby-value str">"type"</span>] = <span class="ruby-identifier">hash</span>[<span class="ruby-value str">"type"</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>[<span class="ruby-value str">"type"</span>]
|
|
222
|
-
97:
|
|
223
|
-
98: <span class="ruby-identifier">entry</span>
|
|
224
|
-
99: <span class="ruby-keyword kw">end</span>
|
|
225
|
-
</pre>
|
|
226
|
-
</div>
|
|
227
|
-
</div>
|
|
228
|
-
</div>
|
|
229
|
-
|
|
230
|
-
<div id="method-M000003" class="method-detail">
|
|
231
|
-
<a name="M000003"></a>
|
|
232
|
-
|
|
233
|
-
<div class="method-heading">
|
|
234
|
-
<a href="#M000003" class="method-signature">
|
|
235
|
-
<span class="method-name">parse</span><span class="method-args">(xml, base = "")</span>
|
|
236
|
-
</a>
|
|
237
|
-
</div>
|
|
238
|
-
|
|
239
|
-
<div class="method-description">
|
|
240
|
-
<p>
|
|
241
|
-
parses XML fetched from <tt>base</tt> into an <a
|
|
242
|
-
href="Entry.html">Atom::Entry</a>
|
|
243
|
-
</p>
|
|
244
|
-
<p><a class="source-toggle" href="#"
|
|
245
|
-
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
|
246
|
-
<div class="method-source-code" id="M000003-source">
|
|
247
|
-
<pre>
|
|
248
|
-
<span class="ruby-comment cmt"># File lib/atom/entry.rb, line 59</span>
|
|
249
|
-
59: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span> <span class="ruby-identifier">xml</span>, <span class="ruby-identifier">base</span> = <span class="ruby-value str">""</span>
|
|
250
|
-
60: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:to_atom_entry</span>
|
|
251
|
-
61: <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">to_atom_entry</span>(<span class="ruby-identifier">base</span>)
|
|
252
|
-
62: <span class="ruby-keyword kw">else</span>
|
|
253
|
-
63: <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">xml</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">to_atom_entry</span>(<span class="ruby-identifier">base</span>)
|
|
254
|
-
64: <span class="ruby-keyword kw">end</span>
|
|
255
|
-
65: <span class="ruby-keyword kw">end</span>
|
|
256
|
-
</pre>
|
|
257
|
-
</div>
|
|
258
|
-
</div>
|
|
259
|
-
</div>
|
|
260
|
-
|
|
261
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
|
262
|
-
|
|
263
|
-
<div id="method-M000002" class="method-detail">
|
|
264
|
-
<a name="M000002"></a>
|
|
265
|
-
|
|
266
|
-
<div class="method-heading">
|
|
267
|
-
<a href="#M000002" class="method-signature">
|
|
268
|
-
<span class="method-name">edit_url</span><span class="method-args">()</span>
|
|
269
|
-
</a>
|
|
270
|
-
</div>
|
|
271
|
-
|
|
272
|
-
<div class="method-description">
|
|
273
|
-
<p>
|
|
274
|
-
the @href of an entry’s link[@rel="edit"]
|
|
275
|
-
</p>
|
|
276
|
-
<p><a class="source-toggle" href="#"
|
|
277
|
-
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
|
278
|
-
<div class="method-source-code" id="M000002-source">
|
|
279
|
-
<pre>
|
|
280
|
-
<span class="ruby-comment cmt"># File lib/atom/app.rb, line 75</span>
|
|
281
|
-
75: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">edit_url</span>
|
|
282
|
-
76: <span class="ruby-keyword kw">begin</span>
|
|
283
|
-
77: <span class="ruby-identifier">edit_link</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">links</span>.<span class="ruby-identifier">find</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">link</span><span class="ruby-operator">|</span>
|
|
284
|
-
78: <span class="ruby-identifier">link</span>[<span class="ruby-value str">"rel"</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"edit"</span>
|
|
285
|
-
79: <span class="ruby-keyword kw">end</span>
|
|
286
|
-
80:
|
|
287
|
-
81: <span class="ruby-identifier">edit_link</span>[<span class="ruby-value str">"href"</span>]
|
|
288
|
-
82: <span class="ruby-keyword kw">rescue</span>
|
|
289
|
-
83: <span class="ruby-keyword kw">nil</span>
|
|
290
|
-
84: <span class="ruby-keyword kw">end</span>
|
|
291
|
-
85: <span class="ruby-keyword kw">end</span>
|
|
292
|
-
</pre>
|
|
293
|
-
</div>
|
|
294
|
-
</div>
|
|
295
|
-
</div>
|
|
296
|
-
|
|
297
|
-
<div id="method-M000005" class="method-detail">
|
|
298
|
-
<a name="M000005"></a>
|
|
299
|
-
|
|
300
|
-
<div class="method-heading">
|
|
301
|
-
<a href="#M000005" class="method-signature">
|
|
302
|
-
<span class="method-name">tag_with</span><span class="method-args">(string)</span>
|
|
303
|
-
</a>
|
|
304
|
-
</div>
|
|
305
|
-
|
|
306
|
-
<div class="method-description">
|
|
307
|
-
<p>
|
|
308
|
-
categorize the entry based on a space-separated string
|
|
309
|
-
</p>
|
|
310
|
-
<p><a class="source-toggle" href="#"
|
|
311
|
-
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
|
312
|
-
<div class="method-source-code" id="M000005-source">
|
|
313
|
-
<pre>
|
|
314
|
-
<span class="ruby-comment cmt"># File lib/atom/entry.rb, line 77</span>
|
|
315
|
-
77: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tag_with</span> <span class="ruby-identifier">string</span>
|
|
316
|
-
78: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">string</span>.<span class="ruby-identifier">nil?</span>
|
|
317
|
-
79:
|
|
318
|
-
80: <span class="ruby-identifier">string</span>.<span class="ruby-identifier">split</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tag</span><span class="ruby-operator">|</span>
|
|
319
|
-
81: <span class="ruby-identifier">categories</span>.<span class="ruby-identifier">new</span>[<span class="ruby-value str">"term"</span>] = <span class="ruby-identifier">tag</span>
|
|
320
|
-
82: <span class="ruby-keyword kw">end</span>
|
|
321
|
-
83: <span class="ruby-keyword kw">end</span>
|
|
322
|
-
</pre>
|
|
323
|
-
</div>
|
|
324
|
-
</div>
|
|
325
|
-
</div>
|
|
326
|
-
|
|
327
|
-
<div id="method-M000004" class="method-detail">
|
|
328
|
-
<a name="M000004"></a>
|
|
329
|
-
|
|
330
|
-
<div class="method-heading">
|
|
331
|
-
<a href="#M000004" class="method-signature">
|
|
332
|
-
<span class="method-name">updated!</span><span class="method-args">()</span>
|
|
333
|
-
</a>
|
|
334
|
-
</div>
|
|
335
|
-
|
|
336
|
-
<div class="method-description">
|
|
337
|
-
<p>
|
|
338
|
-
declare that this entry has updated
|
|
339
|
-
</p>
|
|
340
|
-
<p><a class="source-toggle" href="#"
|
|
341
|
-
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
|
342
|
-
<div class="method-source-code" id="M000004-source">
|
|
343
|
-
<pre>
|
|
344
|
-
<span class="ruby-comment cmt"># File lib/atom/entry.rb, line 72</span>
|
|
345
|
-
72: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">updated!</span>
|
|
346
|
-
73: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">updated</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
|
|
347
|
-
74: <span class="ruby-keyword kw">end</span>
|
|
348
|
-
</pre>
|
|
349
|
-
</div>
|
|
350
|
-
</div>
|
|
351
|
-
</div>
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
</div>
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
</div>
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
<div id="validator-badges">
|
|
361
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
362
|
-
</div>
|
|
363
|
-
|
|
364
|
-
</body>
|
|
365
|
-
</html>
|