twido 0.0.1.beta

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,496 @@
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
+ Module: Twido::Authentication
8
+
9
+ &mdash; Documentation by YARD 0.8.3
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (A)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Twido.html" title="Twido (module)">Twido</a></span></span>
36
+ &raquo;
37
+ <span class="title">Authentication</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: Twido::Authentication
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/twido/authentication.rb</dd>
83
+
84
+ </dl>
85
+ <div class="clear"></div>
86
+
87
+
88
+ <h2>Constant Summary</h2>
89
+
90
+ <dl class="constants">
91
+
92
+ <dt id="USER_CONFIG_PATH-constant" class="">USER_CONFIG_PATH =
93
+
94
+ </dt>
95
+ <dd><pre class="code"><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>~/.twido.conf</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span></pre></dd>
96
+
97
+ </dl>
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+ <h2>
108
+ Class Method Summary
109
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
110
+ </h2>
111
+
112
+ <ul class="summary">
113
+
114
+ <li class="public ">
115
+ <span class="summary_signature">
116
+
117
+ <a href="#authenticate-class_method" title="authenticate (class method)">+ (Object) <strong>authenticate</strong> </a>
118
+
119
+
120
+
121
+ </span>
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ <span class="summary_desc"><div class='inline'>
132
+ <p>Creates a new Twitter::Client with the users credentials Returns a
133
+ Twitter::Client Examples.</p>
134
+ </div></span>
135
+
136
+ </li>
137
+
138
+
139
+ <li class="public ">
140
+ <span class="summary_signature">
141
+
142
+ <a href="#complete_task-class_method" title="complete_task (class method)">+ (Object) <strong>complete_task</strong>(tweet) </a>
143
+
144
+
145
+
146
+ </span>
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+ <span class="summary_desc"><div class='inline'>
157
+ <p>makes a task done by deleting the tweet it came from Returns nil Examples.</p>
158
+ </div></span>
159
+
160
+ </li>
161
+
162
+
163
+ <li class="public ">
164
+ <span class="summary_signature">
165
+
166
+ <a href="#config_exists%3F-class_method" title="config_exists? (class method)">+ (Boolean) <strong>config_exists?</strong> </a>
167
+
168
+
169
+
170
+ </span>
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+ <span class="summary_desc"><div class='inline'>
181
+ <p>Checks to see if the config file exists on the user's home folder.</p>
182
+ </div></span>
183
+
184
+ </li>
185
+
186
+
187
+ <li class="public ">
188
+ <span class="summary_signature">
189
+
190
+ <a href="#load_credentials-class_method" title="load_credentials (class method)">+ (Object) <strong>load_credentials</strong> </a>
191
+
192
+
193
+
194
+ </span>
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+ <span class="summary_desc"><div class='inline'>
205
+ <p>Loads the user's twitter credentials from the config file on the user's
206
+ home folder.</p>
207
+ </div></span>
208
+
209
+ </li>
210
+
211
+
212
+ <li class="public ">
213
+ <span class="summary_signature">
214
+
215
+ <a href="#write_credentials_to_config-class_method" title="write_credentials_to_config (class method)">+ (Object) <strong>write_credentials_to_config</strong>(credentials) </a>
216
+
217
+
218
+
219
+ </span>
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+ <span class="summary_desc"><div class='inline'>
230
+ <p>Writes the user's twitter login credentials to the config file on the
231
+ user's home folder.</p>
232
+ </div></span>
233
+
234
+ </li>
235
+
236
+
237
+ </ul>
238
+
239
+
240
+
241
+
242
+ <div id="class_method_details" class="method_details_list">
243
+ <h2>Class Method Details</h2>
244
+
245
+
246
+ <div class="method_details first">
247
+ <h3 class="signature first" id="authenticate-class_method">
248
+
249
+ + (<tt>Object</tt>) <strong>authenticate</strong>
250
+
251
+
252
+
253
+
254
+
255
+ </h3><div class="docstring">
256
+ <div class="discussion">
257
+
258
+ <p>Creates a new Twitter::Client with the users credentials Returns a
259
+ Twitter::Client Examples</p>
260
+
261
+
262
+ </div>
263
+ </div>
264
+ <div class="tags">
265
+
266
+
267
+ </div><table class="source_code">
268
+ <tr>
269
+ <td>
270
+ <pre class="lines">
271
+
272
+
273
+ 48
274
+ 49
275
+ 50
276
+ 51
277
+ 52
278
+ 53
279
+ 54
280
+ 55
281
+ 56
282
+ 57
283
+ 58</pre>
284
+ </td>
285
+ <td>
286
+ <pre class="code"><span class="info file"># File 'lib/twido/authentication.rb', line 48</span>
287
+
288
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_authenticate'>authenticate</span>
289
+ <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config_exists?'>config_exists?</span>
290
+ <span class='kw'>if</span> <span class='id identifier rubyid_twitter_client'>twitter_client</span> <span class='op'>=</span> <span class='const'>Twitter</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_credentials'>load_credentials</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='rparen'>)</span>
291
+ <span class='id identifier rubyid_twitter_client'>twitter_client</span>
292
+ <span class='kw'>else</span>
293
+ <span class='id identifier rubyid_abort'>abort</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ERROR: Error authenticating your account, run setup to reconfigure</span><span class='tstring_end'>'</span></span>
294
+ <span class='kw'>end</span>
295
+ <span class='kw'>else</span>
296
+ <span class='id identifier rubyid_abort'>abort</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ERROR: You have not setup twido yet, run twido setup to configure it.</span><span class='tstring_end'>'</span></span>
297
+ <span class='kw'>end</span>
298
+ <span class='kw'>end</span></pre>
299
+ </td>
300
+ </tr>
301
+ </table>
302
+ </div>
303
+
304
+ <div class="method_details ">
305
+ <h3 class="signature " id="complete_task-class_method">
306
+
307
+ + (<tt>Object</tt>) <strong>complete_task</strong>(tweet)
308
+
309
+
310
+
311
+
312
+
313
+ </h3><div class="docstring">
314
+ <div class="discussion">
315
+
316
+ <p>makes a task done by deleting the tweet it came from Returns nil Examples</p>
317
+
318
+
319
+ </div>
320
+ </div>
321
+ <div class="tags">
322
+
323
+
324
+ </div><table class="source_code">
325
+ <tr>
326
+ <td>
327
+ <pre class="lines">
328
+
329
+
330
+ 66
331
+ 67
332
+ 68</pre>
333
+ </td>
334
+ <td>
335
+ <pre class="code"><span class="info file"># File 'lib/twido/authentication.rb', line 66</span>
336
+
337
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_complete_task'>complete_task</span><span class='lparen'>(</span><span class='id identifier rubyid_tweet'>tweet</span><span class='rparen'>)</span>
338
+ <span class='const'>Twitter</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='period'>.</span><span class='id identifier rubyid_status_destroy'>status_destroy</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
339
+ <span class='kw'>end</span></pre>
340
+ </td>
341
+ </tr>
342
+ </table>
343
+ </div>
344
+
345
+ <div class="method_details ">
346
+ <h3 class="signature " id="config_exists?-class_method">
347
+
348
+ + (<tt>Boolean</tt>) <strong>config_exists?</strong>
349
+
350
+
351
+
352
+
353
+
354
+ </h3><div class="docstring">
355
+ <div class="discussion">
356
+
357
+ <p>Checks to see if the config file exists on the user's home folder. Returns
358
+ true or false Examples</p>
359
+
360
+
361
+ </div>
362
+ </div>
363
+ <div class="tags">
364
+
365
+ <p class="tag_title">Returns:</p>
366
+ <ul class="return">
367
+
368
+ <li>
369
+
370
+
371
+ <span class='type'>(<tt>Boolean</tt>)</span>
372
+
373
+
374
+
375
+ </li>
376
+
377
+ </ul>
378
+
379
+ </div><table class="source_code">
380
+ <tr>
381
+ <td>
382
+ <pre class="lines">
383
+
384
+
385
+ 14
386
+ 15
387
+ 16</pre>
388
+ </td>
389
+ <td>
390
+ <pre class="code"><span class="info file"># File 'lib/twido/authentication.rb', line 14</span>
391
+
392
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config_exists?'>config_exists?</span>
393
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='const'>USER_CONFIG_PATH</span><span class='rparen'>)</span>
394
+ <span class='kw'>end</span></pre>
395
+ </td>
396
+ </tr>
397
+ </table>
398
+ </div>
399
+
400
+ <div class="method_details ">
401
+ <h3 class="signature " id="load_credentials-class_method">
402
+
403
+ + (<tt>Object</tt>) <strong>load_credentials</strong>
404
+
405
+
406
+
407
+
408
+
409
+ </h3><div class="docstring">
410
+ <div class="discussion">
411
+
412
+ <p>Loads the user's twitter credentials from the config file on the user's
413
+ home folder. Returns a hash filled with the credentials. Examples</p>
414
+
415
+
416
+ </div>
417
+ </div>
418
+ <div class="tags">
419
+
420
+
421
+ </div><table class="source_code">
422
+ <tr>
423
+ <td>
424
+ <pre class="lines">
425
+
426
+
427
+ 37
428
+ 38
429
+ 39</pre>
430
+ </td>
431
+ <td>
432
+ <pre class="code"><span class="info file"># File 'lib/twido/authentication.rb', line 37</span>
433
+
434
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_credentials'>load_credentials</span><span class='lparen'>(</span><span class='rparen'>)</span>
435
+ <span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='const'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_load_file'>load_file</span><span class='lparen'>(</span><span class='const'>USER_CONFIG_PATH</span><span class='rparen'>)</span>
436
+ <span class='kw'>end</span></pre>
437
+ </td>
438
+ </tr>
439
+ </table>
440
+ </div>
441
+
442
+ <div class="method_details ">
443
+ <h3 class="signature " id="write_credentials_to_config-class_method">
444
+
445
+ + (<tt>Object</tt>) <strong>write_credentials_to_config</strong>(credentials)
446
+
447
+
448
+
449
+
450
+
451
+ </h3><div class="docstring">
452
+ <div class="discussion">
453
+
454
+ <p>Writes the user's twitter login credentials to the config file on the
455
+ user's home folder. Returns nil credentials - The user's twitter log in
456
+ credentials. Examples</p>
457
+
458
+
459
+ </div>
460
+ </div>
461
+ <div class="tags">
462
+
463
+
464
+ </div><table class="source_code">
465
+ <tr>
466
+ <td>
467
+ <pre class="lines">
468
+
469
+
470
+ 26
471
+ 27
472
+ 28</pre>
473
+ </td>
474
+ <td>
475
+ <pre class="code"><span class="info file"># File 'lib/twido/authentication.rb', line 26</span>
476
+
477
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_write_credentials_to_config'>write_credentials_to_config</span><span class='lparen'>(</span><span class='id identifier rubyid_credentials'>credentials</span><span class='rparen'>)</span>
478
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='const'>USER_CONFIG_PATH</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>w</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span><span class='lparen'>(</span><span class='id identifier rubyid_credentials'>credentials</span><span class='period'>.</span><span class='id identifier rubyid_to_yaml'>to_yaml</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
479
+ <span class='kw'>end</span></pre>
480
+ </td>
481
+ </tr>
482
+ </table>
483
+ </div>
484
+
485
+ </div>
486
+
487
+ </div>
488
+
489
+ <div id="footer">
490
+ Generated on Mon Dec 17 21:39:20 2012 by
491
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
492
+ 0.8.3 (ruby-1.9.3).
493
+ </div>
494
+
495
+ </body>
496
+ </html>