safubot 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardoc/checksums +9 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/README.md +52 -1
- data/doc/Safubot/Bot.html +1287 -652
- data/doc/Safubot/Evented.html +409 -276
- data/doc/Safubot/KnownUser.html +476 -254
- data/doc/Safubot/Log.html +184 -192
- data/doc/Safubot/Query.html +131 -164
- data/doc/Safubot/Request.html +158 -147
- data/doc/Safubot/Response.html +92 -135
- data/doc/Safubot/Test.html +166 -187
- data/doc/Safubot/Twitter/Bot.html +1005 -455
- data/doc/Safubot/Twitter/DirectMessage.html +417 -238
- data/doc/Safubot/Twitter/Tweet.html +725 -398
- data/doc/Safubot/Twitter.html +69 -116
- data/doc/Safubot/XMPP/Bot.html +625 -303
- data/doc/Safubot/XMPP/Message.html +372 -217
- data/doc/Safubot/XMPP.html +69 -116
- data/doc/Safubot.html +155 -126
- data/doc/_index.html +294 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.README.html +140 -0
- data/doc/file_list.html +49 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +129 -101
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +167 -0
- data/doc/js/jquery.js +3 -5
- data/doc/method_list.html +638 -0
- data/doc/top-level-namespace.html +103 -0
- data/lib/safubot/bot.rb +22 -20
- data/lib/safubot/known_user.rb +2 -0
- data/lib/safubot/twitter.rb +30 -26
- data/lib/safubot/version.rb +1 -1
- data/lib/safubot/xmpp.rb +20 -14
- data/safubot.gemspec +1 -0
- metadata +50 -71
- data/doc/Gemfile.html +0 -119
- data/doc/Object.html +0 -171
- data/doc/Rakefile.html +0 -117
- data/doc/created.rid +0 -14
- data/doc/foo_rb.html +0 -115
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/js/darkfish.js +0 -153
- data/doc/js/navigation.js +0 -142
- data/doc/js/search.js +0 -94
- data/doc/js/search_index.js +0 -1
- data/doc/js/searcher.js +0 -228
- data/doc/lib/safubot/bot_rb.html +0 -115
- data/doc/lib/safubot/evented_rb.html +0 -115
- data/doc/lib/safubot/known_user_rb.html +0 -115
- data/doc/lib/safubot/log_rb.html +0 -115
- data/doc/lib/safubot/safubot_rb.html +0 -115
- data/doc/lib/safubot/spec/bot_spec_rb.html +0 -115
- data/doc/lib/safubot/spec/twitter_spec_rb.html +0 -137
- data/doc/lib/safubot/test_helper_rb.html +0 -115
- data/doc/lib/safubot/twitter_rb.html +0 -115
- data/doc/lib/safubot/version_rb.html +0 -115
- data/doc/lib/safubot/xmpp_rb.html +0 -115
- data/doc/lib/safubot_rb.html +0 -115
- data/doc/rdoc.css +0 -543
- data/doc/table_of_contents.html +0 -224
data/doc/Safubot/XMPP/Bot.html
CHANGED
@@ -1,403 +1,725 @@
|
|
1
|
-
<!DOCTYPE html
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta content="text/html; charset=
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Safubot::XMPP::Bot
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.3
|
10
|
+
|
11
|
+
</title>
|
6
12
|
|
7
|
-
<
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
14
|
|
9
|
-
<link type="text/css" media="screen"
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
10
16
|
|
11
|
-
<script type="text/javascript">
|
12
|
-
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '../..';
|
19
|
+
if (relpath != '') relpath += '/';
|
13
20
|
</script>
|
14
21
|
|
15
|
-
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
16
|
-
<script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
|
17
|
-
<script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
|
18
|
-
<script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
|
19
|
-
<script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
|
20
|
-
<script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>
|
21
|
-
|
22
|
-
|
23
|
-
<body id="top" class="class">
|
24
|
-
<nav id="metadata">
|
25
|
-
<nav id="home-section" class="section">
|
26
|
-
<h3 class="section-header">
|
27
|
-
<a href="../../index.html">Home</a>
|
28
|
-
<a href="../../table_of_contents.html#classes">Classes</a>
|
29
|
-
<a href="../../table_of_contents.html#methods">Methods</a>
|
30
|
-
</h3>
|
31
|
-
</nav>
|
32
|
-
|
33
|
-
|
34
|
-
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
-
<form action="#" method="get" accept-charset="utf-8">
|
36
|
-
<h3 class="section-header">
|
37
|
-
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
-
</h3>
|
40
|
-
</form>
|
41
|
-
|
42
|
-
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
-
</nav>
|
44
|
-
|
45
|
-
|
46
|
-
<div id="file-metadata">
|
47
|
-
<nav id="file-list-section" class="section">
|
48
|
-
<h3 class="section-header">Defined In</h3>
|
49
|
-
<ul>
|
50
|
-
<li>lib/safubot/xmpp.rb
|
51
|
-
</ul>
|
52
|
-
</nav>
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
53
23
|
|
54
|
-
|
55
|
-
</div>
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
56
25
|
|
57
|
-
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
58
32
|
|
59
|
-
<
|
60
|
-
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
61
35
|
|
62
|
-
|
36
|
+
<a href="../../_index.html">Index (B)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../../Safubot.html" title="Safubot (module)">Safubot</a></span></span> » <span class='title'><span class='object_link'><a href="../XMPP.html" title="Safubot::XMPP (module)">XMPP</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Bot</span>
|
63
40
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
<nav id="includes-section" class="section">
|
68
|
-
<h3 class="section-header">Included Modules</h3>
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
69
44
|
|
70
|
-
|
45
|
+
<div id="search">
|
71
46
|
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
72
48
|
|
73
|
-
<
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
74
50
|
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
75
52
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<!-- Method Quickref -->
|
80
|
-
<nav id="method-list-section" class="section">
|
81
|
-
<h3 class="section-header">Methods</h3>
|
82
|
-
|
83
|
-
<ul class="link-list">
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
84
56
|
|
85
|
-
<
|
57
|
+
<iframe id="search_frame"></iframe>
|
86
58
|
|
87
|
-
<
|
59
|
+
<div id="content"><h1>Class: Safubot::XMPP::Bot
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName">Object</span>
|
70
|
+
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li>Object</li>
|
73
|
+
|
74
|
+
<li class="next">Safubot::XMPP::Bot</li>
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
<a href="#" class="inheritanceTree">show all</a>
|
78
|
+
|
79
|
+
</dd>
|
88
80
|
|
89
|
-
|
81
|
+
|
82
|
+
|
90
83
|
|
91
|
-
|
84
|
+
|
92
85
|
|
93
|
-
|
94
|
-
</
|
86
|
+
<dt class="r2">Includes:</dt>
|
87
|
+
<dd class="r2"><span class='object_link'><a href="../Evented.html" title="Safubot::Evented (module)">Evented</a></span></dd>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<dt class="r1 last">Defined in:</dt>
|
94
|
+
<dd class="r1 last">lib/safubot/xmpp.rb</dd>
|
95
|
+
|
96
|
+
</dl>
|
97
|
+
<div class="clear"></div>
|
95
98
|
|
96
|
-
</div>
|
97
99
|
|
98
|
-
<div id="project-metadata">
|
99
|
-
<nav id="fileindex-section" class="section project-section">
|
100
|
-
<h3 class="section-header">Pages</h3>
|
101
100
|
|
102
|
-
<ul>
|
103
101
|
|
104
|
-
<li class="file"><a href="../../Gemfile.html">Gemfile</a>
|
105
102
|
|
106
|
-
<li class="file"><a href="../../Rakefile.html">Rakefile</a>
|
107
103
|
|
108
|
-
|
109
|
-
</
|
104
|
+
|
105
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
106
|
+
<ul class="summary">
|
107
|
+
|
108
|
+
<li class="public ">
|
109
|
+
<span class="summary_signature">
|
110
|
+
|
111
|
+
<a href="#client-instance_method" title="#client (instance method)">- (Object) <strong>client</strong> </a>
|
112
|
+
|
110
113
|
|
111
|
-
|
112
|
-
|
114
|
+
|
115
|
+
</span>
|
116
|
+
|
117
|
+
|
118
|
+
<span class="note title readonly">readonly</span>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
113
125
|
|
114
|
-
<ul class="link-list">
|
115
126
|
|
116
|
-
<
|
127
|
+
<span class="summary_desc"><div class='inline'><p>
|
128
|
+
Returns the value of attribute client.
|
129
|
+
</p>
|
130
|
+
</div></span>
|
117
131
|
|
118
|
-
|
132
|
+
</li>
|
133
|
+
|
134
|
+
|
135
|
+
<li class="public ">
|
136
|
+
<span class="summary_signature">
|
137
|
+
|
138
|
+
<a href="#jid-instance_method" title="#jid (instance method)">- (Object) <strong>jid</strong> </a>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
</span>
|
119
143
|
|
120
|
-
<li><a href="../../Safubot/Evented.html">Safubot::Evented</a>
|
121
144
|
|
122
|
-
<
|
145
|
+
<span class="note title readonly">readonly</span>
|
146
|
+
|
123
147
|
|
124
|
-
<li><a href="../../Safubot/Log.html">Safubot::Log</a>
|
125
148
|
|
126
|
-
<li><a href="../../Safubot/Query.html">Safubot::Query</a>
|
127
149
|
|
128
|
-
<li><a href="../../Safubot/Request.html">Safubot::Request</a>
|
129
150
|
|
130
|
-
<li><a href="../../Safubot/Response.html">Safubot::Response</a>
|
131
151
|
|
132
|
-
|
152
|
+
|
133
153
|
|
134
|
-
<
|
154
|
+
<span class="summary_desc"><div class='inline'><p>
|
155
|
+
Returns the value of attribute jid.
|
156
|
+
</p>
|
157
|
+
</div></span>
|
135
158
|
|
136
|
-
|
159
|
+
</li>
|
160
|
+
|
161
|
+
|
162
|
+
<li class="public ">
|
163
|
+
<span class="summary_signature">
|
164
|
+
|
165
|
+
<a href="#state-instance_method" title="#state (instance method)">- (Object) <strong>state</strong> </a>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
</span>
|
170
|
+
|
171
|
+
|
172
|
+
<span class="note title readonly">readonly</span>
|
173
|
+
|
137
174
|
|
138
|
-
<li><a href="../../Safubot/Twitter/DirectMessage.html">Safubot::Twitter::DirectMessage</a>
|
139
175
|
|
140
|
-
<li><a href="../../Safubot/Twitter/Tweet.html">Safubot::Twitter::Tweet</a>
|
141
176
|
|
142
|
-
<li><a href="../../Safubot/XMPP.html">Safubot::XMPP</a>
|
143
177
|
|
144
|
-
<li><a href="../../Safubot/XMPP/Bot.html">Safubot::XMPP::Bot</a>
|
145
178
|
|
146
|
-
|
179
|
+
|
147
180
|
|
148
|
-
<
|
181
|
+
<span class="summary_desc"><div class='inline'><p>
|
182
|
+
Returns the value of attribute state.
|
183
|
+
</p>
|
184
|
+
</div></span>
|
149
185
|
|
186
|
+
</li>
|
187
|
+
|
188
|
+
|
150
189
|
</ul>
|
151
|
-
</nav>
|
152
190
|
|
153
|
-
</div>
|
154
|
-
</nav>
|
155
191
|
|
156
|
-
<div id="documentation">
|
157
|
-
<h1 class="class">class Safubot::XMPP::Bot</h1>
|
158
192
|
|
159
|
-
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
<h2>
|
199
|
+
Instance Method Summary
|
200
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
201
|
+
</h2>
|
202
|
+
|
203
|
+
<ul class="summary">
|
204
|
+
|
205
|
+
<li class="public ">
|
206
|
+
<span class="summary_signature">
|
207
|
+
|
208
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Bot) <strong>initialize</strong>(opts) </a>
|
160
209
|
|
161
|
-
</div><!-- description -->
|
162
210
|
|
211
|
+
|
212
|
+
</span>
|
163
213
|
|
214
|
+
<span class="note title constructor">constructor</span>
|
164
215
|
|
165
216
|
|
166
|
-
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
<span class="summary_desc"><div class='inline'><p>
|
224
|
+
A new instance of Bot.
|
225
|
+
</p>
|
226
|
+
</div></span>
|
227
|
+
|
228
|
+
</li>
|
229
|
+
|
230
|
+
|
231
|
+
<li class="public ">
|
232
|
+
<span class="summary_signature">
|
233
|
+
|
234
|
+
<a href="#run-instance_method" title="#run (instance method)">- (Object) <strong>run</strong> </a>
|
167
235
|
|
168
236
|
|
169
237
|
|
238
|
+
</span>
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
170
245
|
|
246
|
+
|
247
|
+
<span class="summary_desc"><div class='inline'><p>
|
248
|
+
Sets our Blather::Client event processor running.
|
249
|
+
</p>
|
250
|
+
</div></span>
|
251
|
+
|
252
|
+
</li>
|
253
|
+
|
254
|
+
|
255
|
+
<li class="public ">
|
256
|
+
<span class="summary_signature">
|
257
|
+
|
258
|
+
<a href="#send-instance_method" title="#send (instance method)">- (Object) <strong>send</strong>(resp) </a>
|
171
259
|
|
172
260
|
|
173
261
|
|
174
|
-
|
175
|
-
|
176
|
-
|
262
|
+
</span>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
<span class="summary_desc"><div class='inline'><p>
|
272
|
+
Dispatch a Response via XMPP.
|
273
|
+
</p>
|
274
|
+
</div></span>
|
275
|
+
|
276
|
+
</li>
|
177
277
|
|
178
278
|
|
179
|
-
|
180
|
-
|
181
|
-
<span class="method-name">client</span><span
|
182
|
-
class="attribute-access-type">[R]</span>
|
183
|
-
</div>
|
184
|
-
|
185
|
-
<div class="method-description">
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
</div>
|
190
|
-
</div>
|
191
|
-
|
192
|
-
<div id="attribute-i-jid" class="method-detail">
|
193
|
-
<div class="method-heading attribute-method-heading">
|
194
|
-
<span class="method-name">jid</span><span
|
195
|
-
class="attribute-access-type">[R]</span>
|
196
|
-
</div>
|
197
|
-
|
198
|
-
<div class="method-description">
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
</div>
|
203
|
-
</div>
|
204
|
-
|
205
|
-
<div id="attribute-i-state" class="method-detail">
|
206
|
-
<div class="method-heading attribute-method-heading">
|
207
|
-
<span class="method-name">state</span><span
|
208
|
-
class="attribute-access-type">[R]</span>
|
209
|
-
</div>
|
210
|
-
|
211
|
-
<div class="method-description">
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
</div>
|
216
|
-
</div>
|
217
|
-
|
218
|
-
</section><!-- attribute-method-details -->
|
279
|
+
<li class="public ">
|
280
|
+
<span class="summary_signature">
|
219
281
|
|
220
|
-
|
221
|
-
<!-- Methods -->
|
282
|
+
<a href="#stop-instance_method" title="#stop (instance method)">- (Object) <strong>stop</strong> </a>
|
222
283
|
|
223
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
224
|
-
<h3 class="section-header">Public Class Methods</h3>
|
225
284
|
|
226
285
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
286
|
+
</span>
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
235
293
|
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
294
|
+
|
295
|
+
<span class="summary_desc"><div class='inline'><p>
|
296
|
+
Shuts down the Blather client.
|
297
|
+
</p>
|
298
|
+
</div></span>
|
299
|
+
|
300
|
+
</li>
|
240
301
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">opts</span>)
|
245
|
-
<span class="ruby-ivar">@jid</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-value">:jid</span>]
|
246
|
-
<span class="ruby-ivar">@password</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-value">:password</span>]
|
247
|
-
<span class="ruby-ivar">@state</span> = <span class="ruby-value">:stopped</span>
|
248
|
-
<span class="ruby-keyword">end</span></pre>
|
249
|
-
</div><!-- new-source -->
|
250
|
-
|
251
|
-
</div>
|
302
|
+
|
303
|
+
</ul>
|
304
|
+
|
252
305
|
|
253
|
-
|
254
306
|
|
255
|
-
|
256
|
-
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Evented.html" title="Safubot::Evented (module)">Evented</a></span></h3>
|
315
|
+
<p class="inherited"><span class='object_link'><a href="../Evented.html#bind-instance_method" title="Safubot::Evented#bind (method)">#bind</a></span>, <span class='object_link'><a href="../Evented.html#emit-instance_method" title="Safubot::Evented#emit (method)">#emit</a></span>, <span class='object_link'><a href="../Evented.html#on-instance_method" title="Safubot::Evented#on (method)">#on</a></span>, <span class='object_link'><a href="../Evented.html#once-instance_method" title="Safubot::Evented#once (method)">#once</a></span>, <span class='object_link'><a href="../Evented.html#unbind-instance_method" title="Safubot::Evented#unbind (method)">#unbind</a></span></p>
|
316
|
+
<div id="constructor_details" class="method_details_list">
|
317
|
+
<h2>Constructor Details</h2>
|
318
|
+
|
319
|
+
<div class="method_details first">
|
320
|
+
<p class="signature first" id="initialize-instance_method">
|
321
|
+
|
322
|
+
- (<tt><span class='object_link'><a href="" title="Safubot::XMPP::Bot (class)">Bot</a></span></tt>) <strong>initialize</strong>(opts)
|
323
|
+
|
257
324
|
|
258
|
-
|
259
|
-
</section><!-- public-class-method-details -->
|
260
325
|
|
261
|
-
|
262
|
-
|
326
|
+
</p><div class="docstring">
|
327
|
+
<div class="discussion">
|
328
|
+
<p>
|
329
|
+
A new instance of Bot
|
330
|
+
</p>
|
331
|
+
|
263
332
|
|
333
|
+
</div>
|
334
|
+
</div>
|
335
|
+
<div class="tags">
|
336
|
+
|
337
|
+
|
338
|
+
</div><table class="source_code">
|
339
|
+
<tr>
|
340
|
+
<td>
|
341
|
+
<pre class="lines">
|
342
|
+
|
343
|
+
|
344
|
+
136
|
345
|
+
137
|
346
|
+
138
|
347
|
+
139
|
348
|
+
140</pre>
|
349
|
+
</td>
|
350
|
+
<td>
|
351
|
+
<pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 136</span>
|
352
|
+
|
353
|
+
<span class='kw'>def</span> <span class='id initialize'>initialize</span><span class='lparen'>(</span><span class='id opts'>opts</span><span class='rparen'>)</span>
|
354
|
+
<span class='ivar'>@jid</span> <span class='op'>=</span> <span class='id opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:jid</span><span class='rbracket'>]</span>
|
355
|
+
<span class='ivar'>@password</span> <span class='op'>=</span> <span class='id opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:password</span><span class='rbracket'>]</span>
|
356
|
+
<span class='ivar'>@state</span> <span class='op'>=</span> <span class='symbol'>:stopped</span>
|
357
|
+
<span class='kw'>end</span></pre>
|
358
|
+
</td>
|
359
|
+
</tr>
|
360
|
+
</table>
|
361
|
+
</div>
|
362
|
+
|
363
|
+
</div>
|
364
|
+
|
365
|
+
<div id="instance_attr_details" class="attr_details">
|
366
|
+
<h2>Instance Attribute Details</h2>
|
264
367
|
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
368
|
+
|
369
|
+
<span id=""></span>
|
370
|
+
<span id="client-instance_method"></span>
|
371
|
+
<div class="method_details first">
|
372
|
+
<p class="signature first" id="client-instance_method">
|
373
|
+
|
374
|
+
- (<tt>Object</tt>) <strong>client</strong> <span class="extras">(readonly)</span>
|
375
|
+
|
273
376
|
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
377
|
+
|
378
|
+
</p><div class="docstring">
|
379
|
+
<div class="discussion">
|
380
|
+
<p>
|
381
|
+
Returns the value of attribute client
|
382
|
+
</p>
|
278
383
|
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
<
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
<
|
384
|
+
|
385
|
+
</div>
|
386
|
+
</div>
|
387
|
+
<div class="tags">
|
388
|
+
|
389
|
+
|
390
|
+
</div><table class="source_code">
|
391
|
+
<tr>
|
392
|
+
<td>
|
393
|
+
<pre class="lines">
|
394
|
+
|
395
|
+
|
396
|
+
74
|
397
|
+
75
|
398
|
+
76</pre>
|
399
|
+
</td>
|
400
|
+
<td>
|
401
|
+
<pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 74</span>
|
402
|
+
|
403
|
+
<span class='kw'>def</span> <span class='id client'>client</span>
|
404
|
+
<span class='ivar'>@client</span>
|
405
|
+
<span class='kw'>end</span></pre>
|
406
|
+
</td>
|
407
|
+
</tr>
|
408
|
+
</table>
|
409
|
+
</div>
|
410
|
+
|
289
411
|
|
290
|
-
<span
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
<span class="ruby-identifier">emit</span>(<span class="ruby-value">:request</span>, <span class="ruby-constant">Message</span>.<span class="ruby-identifier">from</span>(<span class="ruby-identifier">msg</span>).<span class="ruby-identifier">make_request</span>)
|
298
|
-
<span class="ruby-keyword">end</span>
|
299
|
-
<span class="ruby-keyword">end</span>
|
300
|
-
|
301
|
-
<span class="ruby-ivar">@client</span>.<span class="ruby-identifier">register_handler</span>(<span class="ruby-value">:disconnected</span>) <span class="ruby-keyword">do</span>
|
302
|
-
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@state</span> <span class="ruby-operator">==</span> <span class="ruby-value">:running</span>
|
303
|
-
<span class="ruby-constant">Log</span>.<span class="ruby-identifier">write</span>(<span class="ruby-string">"XMPP disconnected; attempting reconnection."</span>)
|
304
|
-
<span class="ruby-ivar">@client</span>.<span class="ruby-identifier">connect</span>
|
305
|
-
<span class="ruby-keyword">end</span>
|
306
|
-
<span class="ruby-keyword">end</span>
|
307
|
-
|
308
|
-
<span class="ruby-ivar">@client</span>.<span class="ruby-identifier">register_handler</span>(<span class="ruby-value">:error</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
|
309
|
-
<span class="ruby-constant">Log</span>.<span class="ruby-identifier">write</span> <span class="ruby-node">"XMPP Error: #{e}"</span>
|
310
|
-
<span class="ruby-keyword">end</span>
|
311
|
-
|
312
|
-
<span class="ruby-ivar">@client</span>.<span class="ruby-identifier">run</span>
|
313
|
-
|
314
|
-
<span class="ruby-ivar">@state</span> = <span class="ruby-value">:running</span>
|
315
|
-
<span class="ruby-keyword">end</span></pre>
|
316
|
-
</div><!-- run-source -->
|
317
|
-
|
318
|
-
</div>
|
412
|
+
<span id=""></span>
|
413
|
+
<span id="jid-instance_method"></span>
|
414
|
+
<div class="method_details ">
|
415
|
+
<p class="signature " id="jid-instance_method">
|
416
|
+
|
417
|
+
- (<tt>Object</tt>) <strong>jid</strong> <span class="extras">(readonly)</span>
|
418
|
+
|
319
419
|
|
320
|
-
|
420
|
+
|
421
|
+
</p><div class="docstring">
|
422
|
+
<div class="discussion">
|
423
|
+
<p>
|
424
|
+
Returns the value of attribute jid
|
425
|
+
</p>
|
321
426
|
|
322
|
-
|
323
|
-
</div><!-- run-method -->
|
324
427
|
|
428
|
+
</div>
|
429
|
+
</div>
|
430
|
+
<div class="tags">
|
431
|
+
|
432
|
+
|
433
|
+
</div><table class="source_code">
|
434
|
+
<tr>
|
435
|
+
<td>
|
436
|
+
<pre class="lines">
|
437
|
+
|
438
|
+
|
439
|
+
74
|
440
|
+
75
|
441
|
+
76</pre>
|
442
|
+
</td>
|
443
|
+
<td>
|
444
|
+
<pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 74</span>
|
445
|
+
|
446
|
+
<span class='kw'>def</span> <span class='id jid'>jid</span>
|
447
|
+
<span class='ivar'>@jid</span>
|
448
|
+
<span class='kw'>end</span></pre>
|
449
|
+
</td>
|
450
|
+
</tr>
|
451
|
+
</table>
|
452
|
+
</div>
|
325
453
|
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
454
|
+
|
455
|
+
<span id=""></span>
|
456
|
+
<span id="state-instance_method"></span>
|
457
|
+
<div class="method_details ">
|
458
|
+
<p class="signature " id="state-instance_method">
|
459
|
+
|
460
|
+
- (<tt>Object</tt>) <strong>state</strong> <span class="extras">(readonly)</span>
|
461
|
+
|
334
462
|
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
463
|
+
|
464
|
+
</p><div class="docstring">
|
465
|
+
<div class="discussion">
|
466
|
+
<p>
|
467
|
+
Returns the value of attribute state
|
468
|
+
</p>
|
340
469
|
|
341
|
-
|
342
|
-
<div class="method-source-code" id="send-source">
|
343
|
-
<pre><span class="ruby-comment"># File lib/safubot/xmpp.rb, line 111</span>
|
344
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">send</span>(<span class="ruby-identifier">resp</span>)
|
345
|
-
<span class="ruby-identifier">msg</span> = <span class="ruby-constant">Blather</span><span class="ruby-operator">::</span><span class="ruby-constant">Stanza</span><span class="ruby-operator">::</span><span class="ruby-constant">Message</span>.<span class="ruby-identifier">new</span>
|
346
|
-
<span class="ruby-identifier">msg</span>.<span class="ruby-identifier">to</span> = <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">from</span>
|
347
|
-
<span class="ruby-identifier">msg</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">text</span>
|
348
|
-
<span class="ruby-ivar">@client</span>.<span class="ruby-identifier">write</span> <span class="ruby-identifier">msg</span>
|
349
|
-
<span class="ruby-keyword">end</span></pre>
|
350
|
-
</div><!-- send-source -->
|
351
|
-
|
352
|
-
</div>
|
353
470
|
|
354
|
-
|
471
|
+
</div>
|
472
|
+
</div>
|
473
|
+
<div class="tags">
|
474
|
+
|
475
|
+
|
476
|
+
</div><table class="source_code">
|
477
|
+
<tr>
|
478
|
+
<td>
|
479
|
+
<pre class="lines">
|
480
|
+
|
481
|
+
|
482
|
+
74
|
483
|
+
75
|
484
|
+
76</pre>
|
485
|
+
</td>
|
486
|
+
<td>
|
487
|
+
<pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 74</span>
|
488
|
+
|
489
|
+
<span class='kw'>def</span> <span class='id state'>state</span>
|
490
|
+
<span class='ivar'>@state</span>
|
491
|
+
<span class='kw'>end</span></pre>
|
492
|
+
</td>
|
493
|
+
</tr>
|
494
|
+
</table>
|
495
|
+
</div>
|
496
|
+
|
497
|
+
</div>
|
355
498
|
|
356
|
-
|
357
|
-
</div><!-- send-method -->
|
358
499
|
|
500
|
+
<div id="instance_method_details" class="method_details_list">
|
501
|
+
<h2>Instance Method Details</h2>
|
502
|
+
|
359
503
|
|
360
|
-
<div
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
<span class="method-click-advice">click to toggle source</span>
|
366
|
-
</div>
|
367
|
-
|
504
|
+
<div class="method_details first">
|
505
|
+
<p class="signature first" id="run-instance_method">
|
506
|
+
|
507
|
+
- (<tt>Object</tt>) <strong>run</strong>
|
508
|
+
|
368
509
|
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
510
|
+
|
511
|
+
</p><div class="docstring">
|
512
|
+
<div class="discussion">
|
513
|
+
<p>
|
514
|
+
Sets our Blather::Client event processor running.
|
515
|
+
</p>
|
373
516
|
|
374
|
-
|
375
|
-
<div class="method-source-code" id="stop-source">
|
376
|
-
<pre><span class="ruby-comment"># File lib/safubot/xmpp.rb, line 105</span>
|
377
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">stop</span>
|
378
|
-
<span class="ruby-ivar">@state</span> = <span class="ruby-value">:stopped</span>
|
379
|
-
<span class="ruby-ivar">@client</span>.<span class="ruby-identifier">close</span>
|
380
|
-
<span class="ruby-keyword">end</span></pre>
|
381
|
-
</div><!-- stop-source -->
|
382
|
-
|
383
|
-
</div>
|
384
517
|
|
385
|
-
|
518
|
+
</div>
|
519
|
+
</div>
|
520
|
+
<div class="tags">
|
521
|
+
|
522
|
+
|
523
|
+
</div><table class="source_code">
|
524
|
+
<tr>
|
525
|
+
<td>
|
526
|
+
<pre class="lines">
|
527
|
+
|
528
|
+
|
529
|
+
77
|
530
|
+
78
|
531
|
+
79
|
532
|
+
80
|
533
|
+
81
|
534
|
+
82
|
535
|
+
83
|
536
|
+
84
|
537
|
+
85
|
538
|
+
86
|
539
|
+
87
|
540
|
+
88
|
541
|
+
89
|
542
|
+
90
|
543
|
+
91
|
544
|
+
92
|
545
|
+
93
|
546
|
+
94
|
547
|
+
95
|
548
|
+
96
|
549
|
+
97
|
550
|
+
98
|
551
|
+
99
|
552
|
+
100
|
553
|
+
101
|
554
|
+
102
|
555
|
+
103
|
556
|
+
104
|
557
|
+
105
|
558
|
+
106
|
559
|
+
107
|
560
|
+
108
|
561
|
+
109
|
562
|
+
110
|
563
|
+
111
|
564
|
+
112
|
565
|
+
113
|
566
|
+
114
|
567
|
+
115
|
568
|
+
116
|
569
|
+
117
|
570
|
+
118
|
571
|
+
119
|
572
|
+
120</pre>
|
573
|
+
</td>
|
574
|
+
<td>
|
575
|
+
<pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 77</span>
|
576
|
+
|
577
|
+
<span class='kw'>def</span> <span class='id run'>run</span>
|
578
|
+
<span class='ivar'>@client</span> <span class='op'>=</span> <span class='const'>Blather</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id setup'>setup</span><span class='lparen'>(</span><span class='ivar'>@jid</span><span class='comma'>,</span> <span class='ivar'>@password</span><span class='rparen'>)</span>
|
579
|
+
|
580
|
+
<span class='ivar'>@client</span><span class='period'>.</span><span class='id register_handler'>register_handler</span><span class='lparen'>(</span><span class='symbol'>:ready</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
581
|
+
<span class='const'>Log</span><span class='period'>.</span><span class='id info'>info</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>XMPP client is online at </span><span class='embexpr_beg'>#{</span><span class='ivar'>@client</span><span class='period'>.</span><span class='id jid'>jid</span><span class='period'>.</span><span class='id stripped'>stripped</span><span class='rbrace'>}</span><span class='tstring_content'> :D</span><span class='tstring_end'>"</span></span>
|
582
|
+
<span class='id emit'>emit</span><span class='lparen'>(</span><span class='symbol'>:ready</span><span class='rparen'>)</span>
|
583
|
+
<span class='kw'>end</span>
|
584
|
+
|
585
|
+
<span class='ivar'>@client</span><span class='period'>.</span><span class='id register_handler'>register_handler</span><span class='lparen'>(</span><span class='symbol'>:subscription</span><span class='comma'>,</span> <span class='symbol'>:request?</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id s'>s</span><span class='op'>|</span>
|
586
|
+
<span class='const'>Log</span><span class='period'>.</span><span class='id info'>info</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Approving subscription request from: </span><span class='embexpr_beg'>#{</span><span class='id s'>s</span><span class='period'>.</span><span class='id from'>from</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
587
|
+
<span class='ivar'>@client</span><span class='period'>.</span><span class='id write'>write</span> <span class='id s'>s</span><span class='period'>.</span><span class='id approve!'>approve!</span>
|
588
|
+
<span class='kw'>end</span>
|
589
|
+
|
590
|
+
<span class='ivar'>@client</span><span class='period'>.</span><span class='id register_handler'>register_handler</span><span class='lparen'>(</span><span class='symbol'>:message</span><span class='comma'>,</span> <span class='symbol'>:chat?</span><span class='comma'>,</span> <span class='symbol'>:body</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id msg'>msg</span><span class='op'>|</span>
|
591
|
+
<span class='kw'>unless</span> <span class='id msg'>msg</span><span class='period'>.</span><span class='id body'>body</span><span class='period'>.</span><span class='id match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\?OTR:</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
|
592
|
+
<span class='id emit'>emit</span><span class='lparen'>(</span><span class='symbol'>:request</span><span class='comma'>,</span> <span class='const'>Message</span><span class='period'>.</span><span class='id from'>from</span><span class='lparen'>(</span><span class='id msg'>msg</span><span class='rparen'>)</span><span class='period'>.</span><span class='id make_request'>make_request</span><span class='rparen'>)</span>
|
593
|
+
<span class='kw'>end</span>
|
594
|
+
<span class='kw'>end</span>
|
595
|
+
|
596
|
+
<span class='ivar'>@client</span><span class='period'>.</span><span class='id register_handler'>register_handler</span><span class='lparen'>(</span><span class='symbol'>:disconnected</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
597
|
+
<span class='kw'>if</span> <span class='ivar'>@state</span> <span class='op'>==</span> <span class='symbol'>:running</span>
|
598
|
+
<span class='const'>Log</span><span class='period'>.</span><span class='id warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>XMPP disconnected; attempting reconnection in 5 seconds.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
599
|
+
<span class='const'>EM</span><span class='op'>::</span><span class='const'>Timer</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='ivar'>@client</span><span class='period'>.</span><span class='id connect'>connect</span> <span class='rbrace'>}</span>
|
600
|
+
<span class='kw'>end</span>
|
601
|
+
<span class='kw'>end</span>
|
602
|
+
|
603
|
+
<span class='ivar'>@client</span><span class='period'>.</span><span class='id register_handler'>register_handler</span><span class='lparen'>(</span><span class='symbol'>:error</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id e'>e</span><span class='op'>|</span>
|
604
|
+
<span class='const'>Log</span><span class='period'>.</span><span class='id error'>error</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unhandled Blather error: </span><span class='embexpr_beg'>#{</span><span class='gvar'>$!</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='gvar'>$@</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
605
|
+
<span class='kw'>end</span>
|
606
|
+
|
607
|
+
<span class='const'>Fiber</span><span class='period'>.</span><span class='id new'>new</span> <span class='kw'>do</span>
|
608
|
+
<span class='kw'>begin</span>
|
609
|
+
<span class='ivar'>@client</span><span class='period'>.</span><span class='id run'>run</span>
|
610
|
+
<span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=></span> <span class='id e'>e</span>
|
611
|
+
<span class='kw'>if</span> <span class='id e'>e</span><span class='period'>.</span><span class='id is_a?'>is_a?</span> <span class='const'>Interrupt</span>
|
612
|
+
<span class='id raise'>raise</span> <span class='id e'>e</span>
|
613
|
+
<span class='kw'>else</span>
|
614
|
+
<span class='const'>Log</span><span class='period'>.</span><span class='id error'>error</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Blather client exited unexpectedly: </span><span class='embexpr_beg'>#{</span><span class='gvar'>$!</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='gvar'>$@</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
615
|
+
<span class='kw'>end</span>
|
616
|
+
<span class='kw'>end</span>
|
617
|
+
<span class='kw'>end</span><span class='period'>.</span><span class='id resume'>resume</span>
|
618
|
+
|
619
|
+
<span class='ivar'>@state</span> <span class='op'>=</span> <span class='symbol'>:running</span>
|
620
|
+
<span class='kw'>end</span></pre>
|
621
|
+
</td>
|
622
|
+
</tr>
|
623
|
+
</table>
|
624
|
+
</div>
|
625
|
+
|
626
|
+
<div class="method_details ">
|
627
|
+
<p class="signature " id="send-instance_method">
|
628
|
+
|
629
|
+
- (<tt>Object</tt>) <strong>send</strong>(resp)
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
</p><div class="docstring">
|
634
|
+
<div class="discussion">
|
635
|
+
<p>
|
636
|
+
Dispatch a Response via XMPP.
|
637
|
+
</p>
|
386
638
|
|
387
|
-
|
388
|
-
</div><!-- stop-method -->
|
389
639
|
|
640
|
+
</div>
|
641
|
+
</div>
|
642
|
+
<div class="tags">
|
643
|
+
|
644
|
+
|
645
|
+
</div><table class="source_code">
|
646
|
+
<tr>
|
647
|
+
<td>
|
648
|
+
<pre class="lines">
|
649
|
+
|
650
|
+
|
651
|
+
129
|
652
|
+
130
|
653
|
+
131
|
654
|
+
132
|
655
|
+
133
|
656
|
+
134</pre>
|
657
|
+
</td>
|
658
|
+
<td>
|
659
|
+
<pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 129</span>
|
660
|
+
|
661
|
+
<span class='kw'>def</span> <span class='id send'>send</span><span class='lparen'>(</span><span class='id resp'>resp</span><span class='rparen'>)</span>
|
662
|
+
<span class='id msg'>msg</span> <span class='op'>=</span> <span class='const'>Blather</span><span class='op'>::</span><span class='const'>Stanza</span><span class='op'>::</span><span class='const'>Message</span><span class='period'>.</span><span class='id new'>new</span>
|
663
|
+
<span class='id msg'>msg</span><span class='period'>.</span><span class='id to'>to</span> <span class='op'>=</span> <span class='id resp'>resp</span><span class='period'>.</span><span class='id request'>request</span><span class='period'>.</span><span class='id source'>source</span><span class='period'>.</span><span class='id from'>from</span>
|
664
|
+
<span class='id msg'>msg</span><span class='period'>.</span><span class='id body'>body</span> <span class='op'>=</span> <span class='id resp'>resp</span><span class='period'>.</span><span class='id text'>text</span>
|
665
|
+
<span class='ivar'>@client</span><span class='period'>.</span><span class='id write'>write</span> <span class='id msg'>msg</span>
|
666
|
+
<span class='kw'>end</span></pre>
|
667
|
+
</td>
|
668
|
+
</tr>
|
669
|
+
</table>
|
670
|
+
</div>
|
390
671
|
|
391
|
-
|
672
|
+
<div class="method_details ">
|
673
|
+
<p class="signature " id="stop-instance_method">
|
674
|
+
|
675
|
+
- (<tt>Object</tt>) <strong>stop</strong>
|
392
676
|
|
393
|
-
</section><!-- 5Buntitled-5D -->
|
394
677
|
|
395
|
-
|
678
|
+
|
679
|
+
</p><div class="docstring">
|
680
|
+
<div class="discussion">
|
681
|
+
<p>
|
682
|
+
Shuts down the Blather client.
|
683
|
+
</p>
|
396
684
|
|
397
685
|
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
686
|
+
</div>
|
687
|
+
</div>
|
688
|
+
<div class="tags">
|
689
|
+
|
690
|
+
|
691
|
+
</div><table class="source_code">
|
692
|
+
<tr>
|
693
|
+
<td>
|
694
|
+
<pre class="lines">
|
695
|
+
|
696
|
+
|
697
|
+
123
|
698
|
+
124
|
699
|
+
125
|
700
|
+
126</pre>
|
701
|
+
</td>
|
702
|
+
<td>
|
703
|
+
<pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 123</span>
|
704
|
+
|
705
|
+
<span class='kw'>def</span> <span class='id stop'>stop</span>
|
706
|
+
<span class='ivar'>@state</span> <span class='op'>=</span> <span class='symbol'>:stopped</span>
|
707
|
+
<span class='ivar'>@client</span><span class='period'>.</span><span class='id close'>close</span>
|
708
|
+
<span class='kw'>end</span></pre>
|
709
|
+
</td>
|
710
|
+
</tr>
|
711
|
+
</table>
|
712
|
+
</div>
|
713
|
+
|
714
|
+
</div>
|
403
715
|
|
716
|
+
</div>
|
717
|
+
|
718
|
+
<div id="footer">
|
719
|
+
Generated on Mon Nov 28 20:20:04 2011 by
|
720
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
721
|
+
0.7.3 (ruby-1.9.2).
|
722
|
+
</div>
|
723
|
+
|
724
|
+
</body>
|
725
|
+
</html>
|