atom-tools 2.0.4 → 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/Rakefile +1 -1
- data/doc/classes/Atom/AttrEl.html +163 -0
- data/doc/classes/Atom/Author.html +113 -0
- data/doc/classes/Atom/AutodiscoveryFailure.html +111 -0
- data/doc/classes/Atom/Categories.html +168 -0
- data/doc/classes/Atom/Category.html +137 -0
- data/doc/classes/Atom/Collection.html +425 -0
- data/doc/classes/Atom/Content.html +170 -0
- data/doc/classes/Atom/Contributor.html +113 -0
- 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 +892 -0
- data/doc/classes/Atom/FileCache.html +287 -0
- data/doc/classes/Atom/HTTP.html +490 -0
- 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 +214 -0
- 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/classes/Atom/Source.html +111 -0
- data/doc/classes/Atom/Subtitle.html +113 -0
- data/doc/classes/Atom/Summary.html +113 -0
- data/doc/classes/Atom/Text.html +372 -0
- 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/classes/XHTML.html +118 -0
- data/doc/created.rid +1 -0
- data/doc/files/README.html +173 -0
- data/doc/files/lib/atom/cache_rb.html +302 -0
- data/doc/files/lib/atom/collection_rb.html +109 -0
- data/doc/files/lib/atom/element_rb.html +110 -0
- data/doc/files/lib/atom/entry_rb.html +111 -0
- data/doc/files/lib/atom/feed_rb.html +111 -0
- data/doc/files/lib/atom/http_rb.html +114 -0
- data/doc/files/lib/atom/service_rb.html +112 -0
- data/doc/files/lib/atom/text_rb.html +109 -0
- data/doc/files/lib/atom/tools_rb.html +108 -0
- data/doc/fr_class_index.html +59 -0
- data/doc/fr_file_index.html +36 -0
- data/doc/fr_method_index.html +137 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/atom/cache.rb +1 -1
- data/lib/atom/http.rb +2 -2
- data/lib/atom/text.rb +15 -6
- data/spec/entry_spec.rb +12 -1
- data/spec/feed_spec.rb +20 -1
- data/spec/fixtures/contacts-feed.xml +34 -0
- data/spec/fixtures/entry-w-xml.xml +24 -0
- metadata +68 -5
@@ -0,0 +1,190 @@
|
|
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>Module: Atom::HTTPResponse</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>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Atom::HTTPResponse</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/atom/http_rb.html">
|
59
|
+
lib/atom/http.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000009">end2end_headers</a>
|
84
|
+
<a href="#M000008">validate_content_type</a>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
<!-- if includes -->
|
92
|
+
|
93
|
+
<div id="section">
|
94
|
+
|
95
|
+
|
96
|
+
<div id="constants-list">
|
97
|
+
<h3 class="section-bar">Constants</h3>
|
98
|
+
|
99
|
+
<div class="name-list">
|
100
|
+
<table summary="Constants">
|
101
|
+
<tr class="top-aligned-row context-row">
|
102
|
+
<td class="context-item-name">HOP_BY_HOP</td>
|
103
|
+
<td>=</td>
|
104
|
+
<td class="context-item-value">['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade']</td>
|
105
|
+
</tr>
|
106
|
+
</table>
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<!-- if method_list -->
|
116
|
+
<div id="methods">
|
117
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
118
|
+
|
119
|
+
<div id="method-M000009" class="method-detail">
|
120
|
+
<a name="M000009"></a>
|
121
|
+
|
122
|
+
<div class="method-heading">
|
123
|
+
<a href="#M000009" class="method-signature">
|
124
|
+
<span class="method-name">end2end_headers</span><span class="method-args">()</span>
|
125
|
+
</a>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<div class="method-description">
|
129
|
+
<p><a class="source-toggle" href="#"
|
130
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
131
|
+
<div class="method-source-code" id="M000009-source">
|
132
|
+
<pre>
|
133
|
+
<span class="ruby-comment cmt"># File lib/atom/http.rb, line 496</span>
|
134
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">end2end_headers</span>
|
135
|
+
<span class="ruby-identifier">hopbyhop</span> = <span class="ruby-constant">HOP_BY_HOP</span>
|
136
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'connection'</span>]
|
137
|
+
<span class="ruby-identifier">hopbyhop</span> <span class="ruby-operator">+=</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'connection'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">strip</span> }
|
138
|
+
<span class="ruby-keyword kw">end</span>
|
139
|
+
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">hopbyhop</span>.<span class="ruby-identifier">member?</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">downcase</span> }
|
140
|
+
<span class="ruby-keyword kw">end</span>
|
141
|
+
</pre>
|
142
|
+
</div>
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
|
146
|
+
<div id="method-M000008" class="method-detail">
|
147
|
+
<a name="M000008"></a>
|
148
|
+
|
149
|
+
<div class="method-heading">
|
150
|
+
<a href="#M000008" class="method-signature">
|
151
|
+
<span class="method-name">validate_content_type</span><span class="method-args">( valid )</span>
|
152
|
+
</a>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
<div class="method-description">
|
156
|
+
<p>
|
157
|
+
this should probably support ranges (eg. text/*)
|
158
|
+
</p>
|
159
|
+
<p><a class="source-toggle" href="#"
|
160
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
161
|
+
<div class="method-source-code" id="M000008-source">
|
162
|
+
<pre>
|
163
|
+
<span class="ruby-comment cmt"># File lib/atom/http.rb, line 486</span>
|
164
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_content_type</span>( <span class="ruby-identifier">valid</span> )
|
165
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPException</span>, <span class="ruby-value str">"HTTP response contains no Content-Type!"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">content_type</span> <span class="ruby-keyword kw">or</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">content_type</span>.<span class="ruby-identifier">empty?</span>
|
166
|
+
|
167
|
+
<span class="ruby-identifier">media_type</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">content_type</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">";"</span>).<span class="ruby-identifier">first</span>
|
168
|
+
|
169
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid</span>.<span class="ruby-identifier">member?</span> <span class="ruby-identifier">media_type</span>.<span class="ruby-identifier">downcase</span>
|
170
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">WrongMimetype</span>, <span class="ruby-node">"unexpected response Content-Type: #{media_type.inspect}. should be one of: #{valid.inspect}"</span>
|
171
|
+
<span class="ruby-keyword kw">end</span>
|
172
|
+
<span class="ruby-keyword kw">end</span>
|
173
|
+
</pre>
|
174
|
+
</div>
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
|
179
|
+
</div>
|
180
|
+
|
181
|
+
|
182
|
+
</div>
|
183
|
+
|
184
|
+
|
185
|
+
<div id="validator-badges">
|
186
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
</body>
|
190
|
+
</html>
|
@@ -0,0 +1,187 @@
|
|
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>Module: Atom::HasCategories</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>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Atom::HasCategories</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/atom/element_rb.html">
|
59
|
+
lib/atom/element.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000017">included</a>
|
84
|
+
<a href="#M000018">tag_with</a>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
<!-- if includes -->
|
92
|
+
|
93
|
+
<div id="section">
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<!-- if method_list -->
|
103
|
+
<div id="methods">
|
104
|
+
<h3 class="section-bar">Public Class methods</h3>
|
105
|
+
|
106
|
+
<div id="method-M000017" class="method-detail">
|
107
|
+
<a name="M000017"></a>
|
108
|
+
|
109
|
+
<div class="method-heading">
|
110
|
+
<a href="#M000017" class="method-signature">
|
111
|
+
<span class="method-name">included</span><span class="method-args">(klass)</span>
|
112
|
+
</a>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<div class="method-description">
|
116
|
+
<p><a class="source-toggle" href="#"
|
117
|
+
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
118
|
+
<div class="method-source-code" id="M000017-source">
|
119
|
+
<pre>
|
120
|
+
<span class="ruby-comment cmt"># File lib/atom/element.rb, line 660</span>
|
121
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">HasCategories</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">klass</span>)
|
122
|
+
<span class="ruby-identifier">klass</span>.<span class="ruby-identifier">atom_elements</span> <span class="ruby-identifier">:category</span>, <span class="ruby-identifier">:categories</span>, <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">Category</span>
|
123
|
+
<span class="ruby-keyword kw">end</span>
|
124
|
+
</pre>
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
130
|
+
|
131
|
+
<div id="method-M000018" class="method-detail">
|
132
|
+
<a name="M000018"></a>
|
133
|
+
|
134
|
+
<div class="method-heading">
|
135
|
+
<a href="#M000018" class="method-signature">
|
136
|
+
<span class="method-name">tag_with</span><span class="method-args">(tags, delimiter = ' ')</span>
|
137
|
+
</a>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<div class="method-description">
|
141
|
+
<p>
|
142
|
+
categorize the entry with each of an array or a space-separated
|
143
|
+
</p>
|
144
|
+
<pre>
|
145
|
+
string
|
146
|
+
</pre>
|
147
|
+
<p><a class="source-toggle" href="#"
|
148
|
+
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
149
|
+
<div class="method-source-code" id="M000018-source">
|
150
|
+
<pre>
|
151
|
+
<span class="ruby-comment cmt"># File lib/atom/element.rb, line 666</span>
|
152
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tag_with</span>(<span class="ruby-identifier">tags</span>, <span class="ruby-identifier">delimiter</span> = <span class="ruby-value str">' '</span>)
|
153
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">tags</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">tags</span>.<span class="ruby-identifier">empty?</span>
|
154
|
+
|
155
|
+
<span class="ruby-identifier">tag_list</span> = <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">tags</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
|
156
|
+
<span class="ruby-identifier">tags</span>
|
157
|
+
<span class="ruby-keyword kw">else</span>
|
158
|
+
<span class="ruby-identifier">tags</span> = <span class="ruby-identifier">tags</span>.<span class="ruby-identifier">split</span>(<span class="ruby-identifier">delimiter</span>)
|
159
|
+
<span class="ruby-identifier">tags</span>.<span class="ruby-identifier">map!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">strip</span> }
|
160
|
+
<span class="ruby-identifier">tags</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">empty?</span> }
|
161
|
+
<span class="ruby-identifier">tags</span>.<span class="ruby-identifier">uniq</span>
|
162
|
+
<span class="ruby-keyword kw">end</span>
|
163
|
+
|
164
|
+
<span class="ruby-identifier">tag_list</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>
|
165
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">categories</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">term</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">tag</span> }
|
166
|
+
<span class="ruby-identifier">categories</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">:term</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">tag</span>
|
167
|
+
<span class="ruby-keyword kw">end</span>
|
168
|
+
<span class="ruby-keyword kw">end</span>
|
169
|
+
<span class="ruby-keyword kw">end</span>
|
170
|
+
</pre>
|
171
|
+
</div>
|
172
|
+
</div>
|
173
|
+
</div>
|
174
|
+
|
175
|
+
|
176
|
+
</div>
|
177
|
+
|
178
|
+
|
179
|
+
</div>
|
180
|
+
|
181
|
+
|
182
|
+
<div id="validator-badges">
|
183
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
184
|
+
</div>
|
185
|
+
|
186
|
+
</body>
|
187
|
+
</html>
|
@@ -0,0 +1,168 @@
|
|
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>Module: Atom::HasLinks</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>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Atom::HasLinks</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/atom/element_rb.html">
|
59
|
+
lib/atom/element.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000011">find_link</a>
|
84
|
+
<a href="#M000010">included</a>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
<!-- if includes -->
|
92
|
+
|
93
|
+
<div id="section">
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<!-- if method_list -->
|
103
|
+
<div id="methods">
|
104
|
+
<h3 class="section-bar">Public Class methods</h3>
|
105
|
+
|
106
|
+
<div id="method-M000010" class="method-detail">
|
107
|
+
<a name="M000010"></a>
|
108
|
+
|
109
|
+
<div class="method-heading">
|
110
|
+
<a href="#M000010" class="method-signature">
|
111
|
+
<span class="method-name">included</span><span class="method-args">(klass)</span>
|
112
|
+
</a>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<div class="method-description">
|
116
|
+
<p><a class="source-toggle" href="#"
|
117
|
+
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
118
|
+
<div class="method-source-code" id="M000010-source">
|
119
|
+
<pre>
|
120
|
+
<span class="ruby-comment cmt"># File lib/atom/element.rb, line 648</span>
|
121
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">HasLinks</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">klass</span>)
|
122
|
+
<span class="ruby-identifier">klass</span>.<span class="ruby-identifier">atom_elements</span> <span class="ruby-identifier">:link</span>, <span class="ruby-identifier">:links</span>, <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">Link</span>
|
123
|
+
<span class="ruby-keyword kw">end</span>
|
124
|
+
</pre>
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
130
|
+
|
131
|
+
<div id="method-M000011" class="method-detail">
|
132
|
+
<a name="M000011"></a>
|
133
|
+
|
134
|
+
<div class="method-heading">
|
135
|
+
<a href="#M000011" class="method-signature">
|
136
|
+
<span class="method-name">find_link</span><span class="method-args">(criteria)</span>
|
137
|
+
</a>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<div class="method-description">
|
141
|
+
<p><a class="source-toggle" href="#"
|
142
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
143
|
+
<div class="method-source-code" id="M000011-source">
|
144
|
+
<pre>
|
145
|
+
<span class="ruby-comment cmt"># File lib/atom/element.rb, line 652</span>
|
146
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_link</span>(<span class="ruby-identifier">criteria</span>)
|
147
|
+
<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">l</span><span class="ruby-operator">|</span>
|
148
|
+
<span class="ruby-identifier">criteria</span>.<span class="ruby-identifier">all?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">k</span>) <span class="ruby-operator">==</span> <span class="ruby-identifier">v</span> }
|
149
|
+
<span class="ruby-keyword kw">end</span>
|
150
|
+
<span class="ruby-keyword kw">end</span>
|
151
|
+
</pre>
|
152
|
+
</div>
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
|
156
|
+
|
157
|
+
</div>
|
158
|
+
|
159
|
+
|
160
|
+
</div>
|
161
|
+
|
162
|
+
|
163
|
+
<div id="validator-badges">
|
164
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
</body>
|
168
|
+
</html>
|