Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Documenting and filling out SNS actions

  • Loading branch information...
commit ba7f94665cbae27f04733a4f269397408095b04d 1 parent 3de2a89
Stephen Eley authored

Showing 33 changed files with 278 additions and 1,329 deletions. Show diff stats Hide diff stats

  1. +2 2 .yardoc/checksums
  2. BIN  .yardoc/objects/root.dat
  3. +1 1  doc/EventMachine.html
  4. +1 1  doc/EventMachine/AWS.html
  5. +1 1  doc/EventMachine/AWS/Error.html
  6. +1 1  doc/EventMachine/AWS/FailureResponse.html
  7. +1 1  doc/EventMachine/AWS/Inflections.html
  8. +1 1  doc/EventMachine/AWS/Logger.html
  9. +1 1  doc/EventMachine/AWS/Query.html
  10. +1 1  doc/EventMachine/AWS/Query/ClassMethods.html
  11. +1 1  doc/EventMachine/AWS/Query/QueryError.html
  12. +1 1  doc/EventMachine/AWS/Query/QueryFailure.html
  13. +1 1  doc/EventMachine/AWS/Query/QueryParams.html
  14. +1 1  doc/EventMachine/AWS/Query/QueryResponse.html
  15. +1 1  doc/EventMachine/AWS/Query/QueryResult.html
  16. +1 1  doc/EventMachine/AWS/Query/ResponseParser.html
  17. +1 1  doc/EventMachine/AWS/Query/SignatureV2.html
  18. +1 1  doc/EventMachine/AWS/Request.html
  19. +1 1  doc/EventMachine/AWS/Response.html
  20. +77 198 doc/EventMachine/AWS/SNS.html
  21. +1 1  doc/EventMachine/AWS/SQS.html
  22. +1 1  doc/EventMachine/AWS/Service.html
  23. +1 1  doc/EventMachine/AWS/SuccessResponse.html
  24. +1 230 doc/_index.html
  25. +1 1  doc/class_list.html
  26. +1 1  doc/file.README.html
  27. +0 3  doc/file_list.html
  28. +20 169 doc/index.html
  29. +0 680 doc/method_list.html
  30. +1 1  doc/top-level-namespace.html
  31. +6 1 lib/em-aws/query.rb
  32. +49 6 lib/em-aws/sns.rb
  33. +100 17 spec/em-aws/sns_spec.rb
4 .yardoc/checksums
... ... @@ -1,7 +1,7 @@
1 1 lib/em-aws.rb 076a87ded22025b8111ecf9f319f36c66695032a
2 2 lib/em-aws/sqs.rb 16adb7f3b9e2560641d5d02b2c30ace73769be8c
3   -lib/em-aws/sns.rb fbfb93509079b5b3a65baeb552b2d7bc220d2aa8
4   -lib/em-aws/query.rb a7bb2a5cbbe2a31f49151010c1320dd0bcaefe1e
  3 +lib/em-aws/sns.rb a6a07b04e819620f742a28a53a56cc7feec64a08
  4 +lib/em-aws/query.rb be1e707b7634445c1875a49be56af8af1f5d78bd
5 5 lib/em-aws/logger.rb daef37df0f378a80220daf614e0aa7afa52810aa
6 6 lib/em-aws/service.rb b3669e8694caf0b3c0d782eb04f619c5ff5af830
7 7 lib/em-aws/request.rb 68c12bb7dd24cb3f06bef44bf165a0aaff816b0e
BIN  .yardoc/objects/root.dat
Binary file not shown
2  doc/EventMachine.html
@@ -101,7 +101,7 @@
101 101 </div>
102 102
103 103 <div id="footer">
104   - Generated on Sat Mar 3 14:35:09 2012 by
  104 + Generated on Mon Mar 5 19:27:16 2012 by
105 105 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
106 106 0.7.5 (ruby-1.9.3).
107 107 </div>
2  doc/EventMachine/AWS.html
@@ -485,7 +485,7 @@ <h3 class="inherited">Methods included from <span class='object_link'><a href="A
485 485 </div>
486 486
487 487 <div id="footer">
488   - Generated on Sat Mar 3 14:35:09 2012 by
  488 + Generated on Mon Mar 5 19:27:16 2012 by
489 489 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
490 490 0.7.5 (ruby-1.9.3).
491 491 </div>
2  doc/EventMachine/AWS/Error.html
@@ -111,7 +111,7 @@
111 111 </div>
112 112
113 113 <div id="footer">
114   - Generated on Sat Mar 3 14:35:09 2012 by
  114 + Generated on Mon Mar 5 19:27:16 2012 by
115 115 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
116 116 0.7.5 (ruby-1.9.3).
117 117 </div>
2  doc/EventMachine/AWS/FailureResponse.html
@@ -489,7 +489,7 @@ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="
489 489 </div>
490 490
491 491 <div id="footer">
492   - Generated on Sat Mar 3 14:35:09 2012 by
  492 + Generated on Mon Mar 5 19:27:17 2012 by
493 493 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
494 494 0.7.5 (ruby-1.9.3).
495 495 </div>
2  doc/EventMachine/AWS/Inflections.html
@@ -103,7 +103,7 @@
103 103 </div>
104 104
105 105 <div id="footer">
106   - Generated on Sat Mar 3 14:35:09 2012 by
  106 + Generated on Mon Mar 5 19:27:17 2012 by
107 107 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108 108 0.7.5 (ruby-1.9.3).
109 109 </div>
2  doc/EventMachine/AWS/Logger.html
@@ -443,7 +443,7 @@
443 443 </div>
444 444
445 445 <div id="footer">
446   - Generated on Sat Mar 3 14:35:09 2012 by
  446 + Generated on Mon Mar 5 19:27:16 2012 by
447 447 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
448 448 0.7.5 (ruby-1.9.3).
449 449 </div>
2  doc/EventMachine/AWS/Query.html
@@ -698,7 +698,7 @@ <h3 class="inherited">Methods included from <span class='object_link'><a href="Q
698 698 </div>
699 699
700 700 <div id="footer">
701   - Generated on Sat Mar 3 14:35:09 2012 by
  701 + Generated on Mon Mar 5 19:27:16 2012 by
702 702 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
703 703 0.7.5 (ruby-1.9.3).
704 704 </div>
2  doc/EventMachine/AWS/Query/ClassMethods.html
@@ -209,7 +209,7 @@
209 209 </div>
210 210
211 211 <div id="footer">
212   - Generated on Sat Mar 3 14:35:09 2012 by
  212 + Generated on Mon Mar 5 19:27:16 2012 by
213 213 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
214 214 0.7.5 (ruby-1.9.3).
215 215 </div>
2  doc/EventMachine/AWS/Query/QueryError.html
@@ -464,7 +464,7 @@
464 464 </div>
465 465
466 466 <div id="footer">
467   - Generated on Sat Mar 3 14:35:09 2012 by
  467 + Generated on Mon Mar 5 19:27:17 2012 by
468 468 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
469 469 0.7.5 (ruby-1.9.3).
470 470 </div>
2  doc/EventMachine/AWS/Query/QueryFailure.html
@@ -384,7 +384,7 @@ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="
384 384 </div>
385 385
386 386 <div id="footer">
387   - Generated on Sat Mar 3 14:35:09 2012 by
  387 + Generated on Mon Mar 5 19:27:17 2012 by
388 388 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
389 389 0.7.5 (ruby-1.9.3).
390 390 </div>
2  doc/EventMachine/AWS/Query/QueryParams.html
@@ -194,7 +194,7 @@
194 194 </div>
195 195
196 196 <div id="footer">
197   - Generated on Sat Mar 3 14:35:09 2012 by
  197 + Generated on Mon Mar 5 19:27:17 2012 by
198 198 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
199 199 0.7.5 (ruby-1.9.3).
200 200 </div>
2  doc/EventMachine/AWS/Query/QueryResponse.html
@@ -510,7 +510,7 @@
510 510 </div>
511 511
512 512 <div id="footer">
513   - Generated on Sat Mar 3 14:35:09 2012 by
  513 + Generated on Mon Mar 5 19:27:17 2012 by
514 514 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
515 515 0.7.5 (ruby-1.9.3).
516 516 </div>
2  doc/EventMachine/AWS/Query/QueryResult.html
@@ -239,7 +239,7 @@ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="
239 239 </div>
240 240
241 241 <div id="footer">
242   - Generated on Sat Mar 3 14:35:09 2012 by
  242 + Generated on Mon Mar 5 19:27:17 2012 by
243 243 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
244 244 0.7.5 (ruby-1.9.3).
245 245 </div>
2  doc/EventMachine/AWS/Query/ResponseParser.html
@@ -500,7 +500,7 @@
500 500 </div>
501 501
502 502 <div id="footer">
503   - Generated on Sat Mar 3 14:35:10 2012 by
  503 + Generated on Mon Mar 5 19:27:17 2012 by
504 504 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
505 505 0.7.5 (ruby-1.9.3).
506 506 </div>
2  doc/EventMachine/AWS/Query/SignatureV2.html
@@ -757,7 +757,7 @@
757 757 </div>
758 758
759 759 <div id="footer">
760   - Generated on Sat Mar 3 14:35:09 2012 by
  760 + Generated on Mon Mar 5 19:27:17 2012 by
761 761 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
762 762 0.7.5 (ruby-1.9.3).
763 763 </div>
2  doc/EventMachine/AWS/Request.html
@@ -881,7 +881,7 @@
881 881 </div>
882 882
883 883 <div id="footer">
884   - Generated on Sat Mar 3 14:35:09 2012 by
  884 + Generated on Mon Mar 5 19:27:17 2012 by
885 885 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
886 886 0.7.5 (ruby-1.9.3).
887 887 </div>
2  doc/EventMachine/AWS/Response.html
@@ -469,7 +469,7 @@
469 469 </div>
470 470
471 471 <div id="footer">
472   - Generated on Sat Mar 3 14:35:09 2012 by
  472 + Generated on Mon Mar 5 19:27:17 2012 by
473 473 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
474 474 0.7.5 (ruby-1.9.3).
475 475 </div>
275 doc/EventMachine/AWS/SNS.html
@@ -138,7 +138,7 @@ <h3 class="inherited">Attributes inherited from <span class='object_link'><a hre
138 138 <li class="public ">
139 139 <span class="summary_signature">
140 140
141   - <a href="#create_topic-instance_method" title="#create_topic (instance method)">- (EventMachine::AWS::Request) <strong>create_topic</strong> {|response| ... }</a>
  141 + <a href="#add_permission-instance_method" title="#add_permission (instance method)">- (Object) <strong>add_permission</strong> </a>
142 142
143 143
144 144
@@ -151,7 +151,7 @@ <h3 class="inherited">Attributes inherited from <span class='object_link'><a hre
151 151
152 152
153 153
154   - <span class="summary_desc"><div class='inline'><p>Amazon API query.</p>
  154 + <span class="summary_desc"><div class='inline'><p>Modifies the Access Control List (ACL) of a single topic.</p>
155 155 </div></span>
156 156
157 157 </li>
@@ -160,7 +160,7 @@ <h3 class="inherited">Attributes inherited from <span class='object_link'><a hre
160 160 <li class="public ">
161 161 <span class="summary_signature">
162 162
163   - <a href="#delete_topic-instance_method" title="#delete_topic (instance method)">- (EventMachine::AWS::Request) <strong>delete_topic</strong> {|response| ... }</a>
  163 + <a href="#create_topic-instance_method" title="#create_topic (instance method)">- (Object) <strong>create_topic</strong> </a>
164 164
165 165
166 166
@@ -173,8 +173,7 @@ <h3 class="inherited">Attributes inherited from <span class='object_link'><a hre
173 173
174 174
175 175
176   - <span class="summary_desc"><div class='inline'><p>Amazon API query.</p>
177   -</div></span>
  176 + <span class="summary_desc"><div class='inline'></div></span>
178 177
179 178 </li>
180 179
@@ -182,7 +181,7 @@ <h3 class="inherited">Attributes inherited from <span class='object_link'><a hre
182 181 <li class="public ">
183 182 <span class="summary_signature">
184 183
185   - <a href="#list_topics-instance_method" title="#list_topics (instance method)">- (EventMachine::AWS::Request) <strong>list_topics</strong> {|response| ... }</a>
  184 + <a href="#delete_topic-instance_method" title="#delete_topic (instance method)">- (Object) <strong>delete_topic</strong> </a>
186 185
187 186
188 187
@@ -195,8 +194,7 @@ <h3 class="inherited">Attributes inherited from <span class='object_link'><a hre
195 194
196 195
197 196
198   - <span class="summary_desc"><div class='inline'><p>Amazon API query.</p>
199   -</div></span>
  197 + <span class="summary_desc"><div class='inline'></div></span>
200 198
201 199 </li>
202 200
@@ -252,126 +250,115 @@ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="
252 250
253 251
254 252 <div class="method_details first">
255   - <p class="signature first" id="create_topic-instance_method">
  253 + <p class="signature first" id="add_permission-instance_method">
256 254
257   - - (<tt><span class='object_link'><a href="Request.html" title="EventMachine::AWS::Request (class)">EventMachine::AWS::Request</a></span></tt>) <strong>create_topic</strong> {|response| ... }
  255 + - (<tt>Object</tt>) <strong>add_permission</strong>
258 256
259 257
260 258
261 259 </p><div class="docstring">
262 260 <div class="discussion">
263   - <p>Amazon API query. See Amazon&#39;s documentation for full details.</p>
  261 + <p>Modifies the Access Control List (ACL) of a single topic. Can allow one or more actions for one or more AWS accounts.</p>
  262 +
  263 +<p>Because the API for specifying multiple permissions is somewhat roundabout, <strong>EM::AWS</strong>
  264 +supports three different use patterns for adding permissions:</p>
264 265
265 266
266 267 </div>
267 268 </div>
268 269 <div class="tags">
269   - <h3>Parameters:</h3>
270   -<ul class="param">
271 270
272   - <li>
273   -
274   - <span class='name'>params</span>
275   -
276   -
277   - <span class='type'>(<tt>Hash</tt>)</span>
278   -
279   -
280   -
281   - &mdash;
282   - <div class='inline'><p>Parameters passed to Amazon; see below</p>
283   -</div>
284   -
285   - </li>
286   -
287   -</ul>
  271 + <div class="examples">
  272 + <h3>Examples:</h3>
  273 +
  274 + <h4><div class='inline'><p>Specify a single <code>:aws_account_id</code> and a single <code>:action_name</code> param:</p>
  275 +</div></h4>
  276 + <pre class="example code"><span class='id identifier rubyid_sns'>sns</span><span class='period'>.</span><span class='id identifier rubyid_add_permission'>add_permission</span> <span class='label'>aws_account_id:</span> <span class='int'>123456789012</span><span class='comma'>,</span> <span class='label'>action_name:</span> <span class='symbol'>:get_topic_attributes</span></pre>
  277 +
  278 + <h4><div class='inline'><p>Assign an array for <code>:aws_account_id</code> and a corresponding array for <code>:action_name</code>:</p>
  279 +</div></h4>
  280 + <pre class="example code"><span class='id identifier rubyid_sns'>sns</span><span class='period'>.</span><span class='id identifier rubyid_add_permission'>add_permission</span> <span class='label'>aws_account_id:</span> <span class='lbracket'>[</span><span class='int'>123456789012</span><span class='comma'>,</span> <span class='int'>123456789012</span><span class='comma'>,</span> <span class='int'>109876543210</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>action_name:</span> <span class='lbracket'>[</span><span class='symbol'>:subscribe</span><span class='comma'>,</span> <span class='symbol'>:get_topic_attributes</span><span class='comma'>,</span> <span class='symbol'>:subscribe</span><span class='rbracket'>]</span></pre>
  281 +
  282 + <h4><div class='inline'><p>Specify a <code>:permissions</code> hash where each key is an AWS account ID and each value is a permission or array of permissions:</p>
  283 +</div></h4>
  284 + <pre class="example code"><span class='id identifier rubyid_sns'>sns</span><span class='period'>.</span><span class='id identifier rubyid_add_permission'>add_permission</span> <span class='label'>permissions:</span> <span class='lbrace'>{</span><span class='int'>123456789012</span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='symbol'>:subscribe</span><span class='comma'>,</span> <span class='symbol'>:get_topic_attributes</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='int'>109876543210</span> <span class='op'>=&gt;</span> <span class='symbol'>:subscribe</span><span class='rbrace'>}</span></pre>
  285 +
  286 + </div>
288 287
289   -<h3>Yields:</h3>
290   -<ul class="yield">
  288 +<h3>Request Parameters:</h3>
  289 +<ul class="request">
291 290
292 291 <li>
293 292
  293 + <span class='name'>:topic_arn</span>
  294 +
294 295
295   - <span class='type'></span>
  296 + <span class='type'>(<tt>String</tt>)</span>
296 297
297 298
298 299
299   -
300   - <div class='inline'><p>Runs the given block as a callback on successful response</p>
  300 + &mdash;
  301 + <div class='inline'><p>The topic whose ACL you wish to modify</p>
301 302 </div>
302 303
303 304 </li>
304 305
305   -</ul>
306   -<h3>Yield Parameters:</h3>
307   -<ul class="yieldparam">
308   -
309 306 <li>
310 307
311   - <span class='name'>response</span>
  308 + <span class='name'>:label</span>
312 309
313 310
314   - <span class='type'>(<tt><span class='object_link'><a href="Query/QueryResult.html" title="EventMachine::AWS::Query::QueryResult (class)">QueryResult</a></span></tt>)</span>
  311 + <span class='type'>(<tt>String</tt>)</span>
315 312
316 313
317 314
318 315 &mdash;
319   - <div class='inline'><p>Response object containing data from Amazon</p>
  316 + <div class='inline'><p>A <em>unique</em> name for the new policy statement</p>
320 317 </div>
321 318
322 319 </li>
323 320
324   -</ul>
325   -<h3>Returns:</h3>
326   -<ul class="return">
327   -
328 321 <li>
329 322
  323 + <span class='name'>:permissions</span>
330 324
331   - <span class='type'>(<tt><span class='object_link'><a href="Request.html" title="EventMachine::AWS::Request (class)">EventMachine::AWS::Request</a></span></tt>)</span>
  325 +
  326 + <span class='type'>(<tt>optional</tt>, <tt>Hash</tt>)</span>
332 327
333 328
334 329
335 330 &mdash;
336   - <div class='inline'><p>Request object that (eventually) encapsulates the response</p>
  331 + <div class='inline'><p>Shortcut to map account IDs (keys) to one or more actions (values)</p>
337 332 </div>
338 333
339 334 </li>
340 335
341   -</ul>
342   -<h3>Request Parameters:</h3>
343   -<ul class="request">
344   -
345 336 <li>
346 337
347   - <span class='name'>:name</span>
  338 + <span class='name'>:aws_account_id</span>
348 339
349 340
350   - <span class='type'>(<tt>String</tt>)</span>
  341 + <span class='type'>(<tt>optional</tt>, <tt>String</tt>, <tt>Integer</tt>, <tt>Array</tt>)</span>
351 342
352 343
353 344
354 345 &mdash;
355   - <div class='inline'><p>Topic name (letters, numbers and hyphens only)</p>
  346 + <div class='inline'><p>An ID or array of IDs for which new permissions should be added. <em>Required if <code>:permissions</code> is not used.</em></p>
356 347 </div>
357 348
358 349 </li>
359 350
360   -</ul>
361   -<h3>Response Attributes:</h3>
362   -<ul class="response">
363   -
364 351 <li>
365 352
366   - <span class='name'>:topic_arn</span>
  353 + <span class='name'>:action_name</span>
367 354
368 355
369   - <span class='type'>(<tt>String</tt>)</span>
  356 + <span class='type'>(<tt>optional</tt>, <tt>String</tt>, <tt>Symbol</tt>, <tt>Array</tt>)</span>
370 357
371 358
372 359
373 360 &mdash;
374   - <div class='inline'><p>Amazon Resource Name (ARN) assigned to the created topic</p>
  361 + <div class='inline'><p>An action or list of actions to enable for the corresponding ID in <code>:aws_account_id</code>. <em>Required if <code>:permissions</code> is not used.</em></p>
375 362 </div>
376 363
377 364 </li>
@@ -384,107 +371,53 @@ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="
384 371 <pre class="lines">
385 372
386 373
387   -18</pre>
  374 +29</pre>
388 375 </td>
389 376 <td>
390   - <pre class="code"><span class="info file"># File 'lib/em-aws/sns.rb', line 18</span>
  377 + <pre class="code"><span class="info file"># File 'lib/em-aws/sns.rb', line 29</span>
391 378
392   -<span class='id identifier rubyid_action'>action</span> <span class='symbol'>:create_topic</span></pre>
  379 +<span class='id identifier rubyid_action'>action</span> <span class='symbol'>:add_permission</span></pre>
393 380 </td>
394 381 </tr>
395 382 </table>
396 383 </div>
397 384
398 385 <div class="method_details ">
399   - <p class="signature " id="delete_topic-instance_method">
  386 + <p class="signature " id="create_topic-instance_method">
400 387
401   - - (<tt><span class='object_link'><a href="Request.html" title="EventMachine::AWS::Request (class)">EventMachine::AWS::Request</a></span></tt>) <strong>delete_topic</strong> {|response| ... }
  388 + - (<tt>Object</tt>) <strong>create_topic</strong>
402 389
403 390
404 391
405 392 </p><div class="docstring">
406 393 <div class="discussion">
407   - <p>Amazon API query. See Amazon&#39;s documentation for full details.</p>
408   -
  394 +
409 395
410 396 </div>
411 397 </div>
412 398 <div class="tags">
413   - <h3>Parameters:</h3>
414   -<ul class="param">
415   -
416   - <li>
417   -
418   - <span class='name'>params</span>
419   -
420   -
421   - <span class='type'>(<tt>Hash</tt>)</span>
422   -
423   -
424   -
425   - &mdash;
426   - <div class='inline'><p>Parameters passed to Amazon; see below</p>
427   -</div>
428   -
429   - </li>
430   -
431   -</ul>
432   -
433   -<h3>Yields:</h3>
434   -<ul class="yield">
435   -
436   - <li>
437   -
438   -
439   - <span class='type'></span>
440   -
441   -
442   -
443   -
444   - <div class='inline'><p>Runs the given block as a callback on successful response</p>
445   -</div>
446   -
447   - </li>
448 399
449   -</ul>
450   -<h3>Yield Parameters:</h3>
451   -<ul class="yieldparam">
  400 +<h3>Request Parameters:</h3>
  401 +<ul class="request">
452 402
453 403 <li>
454 404
455   - <span class='name'>response</span>
456   -
457   -
458   - <span class='type'>(<tt><span class='object_link'><a href="Query/QueryResult.html" title="EventMachine::AWS::Query::QueryResult (class)">QueryResult</a></span></tt>)</span>
459   -
460   -
461   -
462   - &mdash;
463   - <div class='inline'><p>Response object containing data from Amazon</p>
464   -</div>
465   -
466   - </li>
467   -
468   -</ul>
469   -<h3>Returns:</h3>
470   -<ul class="return">
471   -
472   - <li>
  405 + <span class='name'>:name</span>
473 406
474 407
475   - <span class='type'>(<tt><span class='object_link'><a href="Request.html" title="EventMachine::AWS::Request (class)">EventMachine::AWS::Request</a></span></tt>)</span>
  408 + <span class='type'>(<tt>String</tt>)</span>
476 409
477 410
478 411
479 412 &mdash;
480   - <div class='inline'><p>Request object that (eventually) encapsulates the response</p>
  413 + <div class='inline'><p>Topic name (letters, numbers and hyphens only)</p>
481 414 </div>
482 415
483 416 </li>
484 417
485 418 </ul>
486   -<h3>Request Parameters:</h3>
487   -<ul class="request">
  419 +<h3>Response Attributes:</h3>
  420 +<ul class="response">
488 421
489 422 <li>
490 423
@@ -496,7 +429,7 @@ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="
496 429
497 430
498 431 &mdash;
499   - <div class='inline'><p>Topic ARN</p>
  432 + <div class='inline'><p>Amazon Resource Name (ARN) assigned to the created topic</p>
500 433 </div>
501 434
502 435 </li>
@@ -509,100 +442,46 @@ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="
509 442 <pre class="lines">
510 443
511 444
512   -24</pre>
  445 +34</pre>
513 446 </td>
514 447 <td>
515   - <pre class="code"><span class="info file"># File 'lib/em-aws/sns.rb', line 24</span>
  448 + <pre class="code"><span class="info file"># File 'lib/em-aws/sns.rb', line 34</span>
516 449
517   -<span class='id identifier rubyid_action'>action</span> <span class='symbol'>:delete_topic</span></pre>
  450 +<span class='id identifier rubyid_action'>action</span> <span class='symbol'>:create_topic</span></pre>
518 451 </td>
519 452 </tr>
520 453 </table>
521 454 </div>
522 455
523 456 <div class="method_details ">
524   - <p class="signature " id="list_topics-instance_method">
  457 + <p class="signature " id="delete_topic-instance_method">
525 458
526   - - (<tt><span class='object_link'><a href="Request.html" title="EventMachine::AWS::Request (class)">EventMachine::AWS::Request</a></span></tt>) <strong>list_topics</strong> {|response| ... }
  459 + - (<tt>Object</tt>) <strong>delete_topic</strong>
527 460
528 461
529 462
530 463 </p><div class="docstring">
531 464 <div class="discussion">
532   - <p>Amazon API query. See Amazon&#39;s documentation for full details.</p>
533   -
  465 +
534 466
535 467 </div>
536 468 </div>
537 469 <div class="tags">
538   - <h3>Parameters:</h3>
539   -<ul class="param">
540 470
541   - <li>
542   -
543   - <span class='name'>params</span>
544   -
545   -
546   - <span class='type'>(<tt>Hash</tt>)</span>
547   -
548   -
549   -
550   - &mdash;
551   - <div class='inline'><p>Parameters passed to Amazon; see below</p>
552   -</div>
553   -
554   - </li>
555   -
556   -</ul>
557   -
558   -<h3>Yields:</h3>
559   -<ul class="yield">
560   -
561   - <li>
562   -
563   -
564   - <span class='type'></span>
565   -
566   -
567   -
568   -
569   - <div class='inline'><p>Runs the given block as a callback on successful response</p>
570   -</div>
571   -
572   - </li>
573   -
574   -</ul>
575   -<h3>Yield Parameters:</h3>
576   -<ul class="yieldparam">
  471 +<h3>Request Parameters:</h3>
  472 +<ul class="request">
577 473
578 474 <li>
579 475
580   - <span class='name'>response</span>
581   -
582   -
583   - <span class='type'>(<tt><span class='object_link'><a href="Query/QueryResult.html" title="EventMachine::AWS::Query::QueryResult (class)">QueryResult</a></span></tt>)</span>
584   -
585   -
586   -
587   - &mdash;
588   - <div class='inline'><p>Response object containing data from Amazon</p>
589   -</div>
590   -
591   - </li>
592   -
593   -</ul>
594   -<h3>Returns:</h3>
595   -<ul class="return">
596   -
597   - <li>
  476 + <span class='name'>:topic_arn</span>
598 477
599 478
600   - <span class='type'>(<tt><span class='object_link'><a href="Request.html" title="EventMachine::AWS::Request (class)">EventMachine::AWS::Request</a></span></tt>)</span>
  479 + <span class='type'>(<tt>String</tt>)</span>
601 480
602 481
603 482
604 483 &mdash;
605   - <div class='inline'><p>Request object that (eventually) encapsulates the response</p>
  484 + <div class='inline'><p>Topic ARN</p>
606 485 </div>
607 486
608 487 </li>
@@ -615,12 +494,12 @@ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="
615 494 <pre class="lines">
616 495
617 496
618   -21</pre>
  497 +40</pre>
619 498 </td>
620 499 <td>
621   - <pre class="code"><span class="info file"># File 'lib/em-aws/sns.rb', line 21</span>
  500 + <pre class="code"><span class="info file"># File 'lib/em-aws/sns.rb', line 40</span>
622 501
623   -<span class='id identifier rubyid_action'>action</span> <span class='symbol'>:list_topics</span></pre>
  502 +<span class='id identifier rubyid_action'>action</span> <span class='symbol'>:delete_topic</span></pre>
624 503 </td>
625 504 </tr>
626 505 </table>
@@ -631,7 +510,7 @@ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="
631 510 </div>
632 511
633 512 <div id="footer">
634   - Generated on Sat Mar 3 14:35:09 2012 by
  513 + Generated on Mon Mar 5 19:27:16 2012 by
635 514 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
636 515 0.7.5 (ruby-1.9.3).
637 516 </div>
2  doc/EventMachine/AWS/SQS.html
@@ -411,7 +411,7 @@ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="
411 411 </div>
412 412
413 413 <div id="footer">
414   - Generated on Sat Mar 3 14:35:09 2012 by
  414 + Generated on Mon Mar 5 19:27:16 2012 by
415 415 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
416 416 0.7.5 (ruby-1.9.3).
417 417 </div>
2  doc/EventMachine/AWS/Service.html
@@ -789,7 +789,7 @@
789 789 </div>
790 790
791 791 <div id="footer">
792   - Generated on Sat Mar 3 14:35:09 2012 by
  792 + Generated on Mon Mar 5 19:27:16 2012 by
793 793 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
794 794 0.7.5 (ruby-1.9.3).
795 795 </div>
2  doc/EventMachine/AWS/SuccessResponse.html
@@ -230,7 +230,7 @@ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="
230 230 </div>
231 231
232 232 <div id="footer">
233   - Generated on Sat Mar 3 14:35:09 2012 by
  233 + Generated on Mon Mar 5 19:27:17 2012 by
234 234 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
235 235 0.7.5 (ruby-1.9.3).
236 236 </div>
231 doc/_index.html
@@ -56,15 +56,6 @@
56 56 <div id="listing">
57 57 <h1 class="alphaindex">Alphabetic Index</h1>
58 58
59   - <h2>File Listing</h2>
60   - <ul id="files">
61   -
62   -
63   - <li class="r1"><a href="index.html" title="README">README</a></li>
64   -
65   -
66   - </ul>
67   -
68 59 <div class="clear"></div>
69 60 <h2>Namespace Listing A-Z</h2>
70 61
@@ -75,226 +66,6 @@ <h1 class="alphaindex">Alphabetic Index</h1>
75 66 <tr>
76 67 <td valign='top' width="33%">
77 68
78   -
79   - <ul id="alpha_A" class="alpha">
80   - <li class="letter">A</li>
81   - <ul>
82   -
83   - <li>
84   - <span class='object_link'><a href="EventMachine/AWS.html" title="EventMachine::AWS (module)">AWS</a></span>
85   -
86   - <small>(EventMachine)</small>
87   -
88   - </li>
89   -
90   - </ul>
91   - </ul>
92   -
93   -
94   - <ul id="alpha_C" class="alpha">
95   - <li class="letter">C</li>
96   - <ul>
97   -
98   - <li>
99   - <span class='object_link'><a href="EventMachine/AWS/Query/ClassMethods.html" title="EventMachine::AWS::Query::ClassMethods (module)">ClassMethods</a></span>
100   -
101   - <small>(EventMachine::AWS::Query)</small>
102   -
103   - </li>
104   -
105   - </ul>
106   - </ul>
107   -
108   -
109   - <ul id="alpha_E" class="alpha">
110   - <li class="letter">E</li>
111   - <ul>
112   -
113   - <li>
114   - <span class='object_link'><a href="EventMachine/AWS/Error.html" title="EventMachine::AWS::Error (class)">Error</a></span>
115   -
116   - <small>(EventMachine::AWS)</small>
117   -
118   - </li>
119   -
120   - <li>
121   - <span class='object_link'><a href="EventMachine.html" title="EventMachine (module)">EventMachine</a></span>
122   -
123   - </li>
124   -
125   - </ul>
126   - </ul>
127   -
128   -
129   - <ul id="alpha_F" class="alpha">
130   - <li class="letter">F</li>
131   - <ul>
132   -
133   - <li>
134   - <span class='object_link'><a href="EventMachine/AWS/FailureResponse.html" title="EventMachine::AWS::FailureResponse (class)">FailureResponse</a></span>
135   -
136   - <small>(EventMachine::AWS)</small>
137   -
138   - </li>
139   -
140   - </ul>
141   - </ul>
142   -
143   -
144   - <ul id="alpha_I" class="alpha">
145   - <li class="letter">I</li>
146   - <ul>
147   -
148   - <li>
149   - <span class='object_link'><a href="EventMachine/AWS/Inflections.html" title="EventMachine::AWS::Inflections (module)">Inflections</a></span>
150   -
151   - <small>(EventMachine::AWS)</small>
152   -
153   - </li>
154   -
155   - </ul>
156   - </ul>
157   -
158   -
159   - <ul id="alpha_L" class="alpha">
160   - <li class="letter">L</li>
161   - <ul>
162   -
163   - <li>
164   - <span class='object_link'><a href="EventMachine/AWS/Logger.html" title="EventMachine::AWS::Logger (module)">Logger</a></span>
165   -
166   - <small>(EventMachine::AWS)</small>
167   -
168   - </li>
169   -
170   - </ul>
171   - </ul>
172   -
173   -
174   - <ul id="alpha_Q" class="alpha">
175   - <li class="letter">Q</li>
176   - <ul>
177   -
178   - <li>
179   - <span class='object_link'><a href="EventMachine/AWS/Query.html" title="EventMachine::AWS::Query (module)">Query</a></span>
180   -
181   - <small>(EventMachine::AWS)</small>
182   -
183   - </li>
184   -
185   - <li>
186   - <span class='object_link'><a href="EventMachine/AWS/Query/QueryError.html" title="EventMachine::AWS::Query::QueryError (class)">QueryError</a></span>
187   -
188   - <small>(EventMachine::AWS::Query)</small>
189   -
190   - </li>
191   -
192   - <li>
193   - <span class='object_link'><a href="EventMachine/AWS/Query/QueryFailure.html" title="EventMachine::AWS::Query::QueryFailure (class)">QueryFailure</a></span>
194   -
195   - <small>(EventMachine::AWS::Query)</small>
196   -
197   - </li>
198   -
199   - <li>
200   - <span class='object_link'><a href="EventMachine/AWS/Query/QueryParams.html" title="EventMachine::AWS::Query::QueryParams (module)">QueryParams</a></span>
201   -
202   - <small>(EventMachine::AWS::Query)</small>
203   -
204   - </li>
205   -
206   - <li>
207   - <span class='object_link'><a href="EventMachine/AWS/Query/QueryResponse.html" title="EventMachine::AWS::Query::QueryResponse (module)">QueryResponse</a></span>
208   -
209   - <small>(EventMachine::AWS::Query)</small>
210   -
211   - </li>
212   -
213   - <li>
214   - <span class='object_link'><a href="EventMachine/AWS/Query/QueryResult.html" title="EventMachine::AWS::Query::QueryResult (class)">QueryResult</a></span>
215   -
216   - <small>(EventMachine::AWS::Query)</small>
217   -
218   - </li>
219   -
220   - </ul>
221   - </ul>
222   -
223   -
224   - </td><td valign='top' width="33%">
225   -
226   -
227   - <ul id="alpha_R" class="alpha">
228   - <li class="letter">R</li>
229   - <ul>
230   -
231   - <li>
232   - <span class='object_link'><a href="EventMachine/AWS/Request.html" title="EventMachine::AWS::Request (class)">Request</a></span>
233   -
234   - <small>(EventMachine::AWS)</small>
235   -
236   - </li>
237   -
238   - <li>
239   - <span class='object_link'><a href="EventMachine/AWS/Response.html" title="EventMachine::AWS::Response (class)">Response</a></span>
240   -
241   - <small>(EventMachine::AWS)</small>
242   -
243   - </li>
244   -
245   - <li>
246   - <span class='object_link'><a href="EventMachine/AWS/Query/ResponseParser.html" title="EventMachine::AWS::Query::ResponseParser (class)">ResponseParser</a></span>
247   -
248   - <small>(EventMachine::AWS::Query)</small>
249   -
250   - </li>
251   -
252   - </ul>
253   - </ul>
254   -
255   -
256   - <ul id="alpha_S" class="alpha">
257   - <li class="letter">S</li>
258   - <ul>
259   -
260   - <li>
261   - <span class='object_link'><a href="EventMachine/AWS/SNS.html" title="EventMachine::AWS::SNS (class)">SNS</a></span>
262   -
263   - <small>(EventMachine::AWS)</small>
264   -
265   - </li>
266   -
267   - <li>
268   - <span class='object_link'><a href="EventMachine/AWS/SQS.html" title="EventMachine::AWS::SQS (class)">SQS</a></span>
269   -
270   - <small>(EventMachine::AWS)</small>
271   -
272   - </li>
273   -
274   - <li>
275   - <span class='object_link'><a href="EventMachine/AWS/Service.html" title="EventMachine::AWS::Service (class)">Service</a></span>
276   -
277   - <small>(EventMachine::AWS)</small>
278   -
279   - </li>
280   -
281   - <li>
282   - <span class='object_link'><a href="EventMachine/AWS/Query/SignatureV2.html" title="EventMachine::AWS::Query::SignatureV2 (class)">SignatureV2</a></span>
283   -
284   - <small>(EventMachine::AWS::Query)</small>
285   -
286   - </li>
287   -
288   - <li>
289   - <span class='object_link'><a href="EventMachine/AWS/SuccessResponse.html" title="EventMachine::AWS::SuccessResponse (class)">SuccessResponse</a></span>
290   -
291   - <small>(EventMachine::AWS)</small>
292   -
293   - </li>
294   -
295   - </ul>
296   - </ul>
297   -
298 69 </td>
299 70 </tr>
300 71 </table>
@@ -304,7 +75,7 @@ <h1 class="alphaindex">Alphabetic Index</h1>
304 75 </div>
305 76
306 77 <div id="footer">
307   - Generated on Sat Mar 3 14:35:09 2012 by
  78 + Generated on Mon Mar 5 19:27:48 2012 by
308 79 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
309 80 0.7.5 (ruby-1.9.3).
310 81 </div>
2  doc/class_list.html
@@ -39,7 +39,7 @@ <h1 id="full_list_header">Class List</h1>
39 39
40 40 <ul id="full_list" class="class">
41 41 <li><span class='object_link'><a href="top-level-namespace.html" title=" (root)">Top Level Namespace</a></span></li>
42   -<li><a class='toggle'></a> <span class='object_link'><a href="EventMachine.html" title="EventMachine (module)">EventMachine</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><a class='toggle'></a> <span class='object_link'><a href="EventMachine/AWS.html" title="EventMachine::AWS (module)">AWS</a></span><small class='search_info'>EventMachine</small></li><ul><li><span class='object_link'><a href="EventMachine/AWS/Error.html" title="EventMachine::AWS::Error (class)">Error</a></span> &lt; StandardError<small class='search_info'>EventMachine::AWS</small></li><li><span class='object_link'><a href="EventMachine/AWS/FailureResponse.html" title="EventMachine::AWS::FailureResponse (class)">FailureResponse</a></span> &lt; Response<small class='search_info'>EventMachine::AWS</small></li><li><span class='object_link'><a href="EventMachine/AWS/Inflections.html" title="EventMachine::AWS::Inflections (module)">Inflections</a></span><small class='search_info'>EventMachine::AWS</small></li><li><span class='object_link'><a href="EventMachine/AWS/Logger.html" title="EventMachine::AWS::Logger (module)">Logger</a></span><small class='search_info'>EventMachine::AWS</small></li><li><a class='toggle'></a> <span class='object_link'><a href="EventMachine/AWS/Query.html" title="EventMachine::AWS::Query (module)">Query</a></span><small class='search_info'>EventMachine::AWS</small></li><ul><li><span class='object_link'><a href="EventMachine/AWS/Query/ClassMethods.html" title="EventMachine::AWS::Query::ClassMethods (module)">ClassMethods</a></span><small class='search_info'>EventMachine::AWS::Query</small></li><li><span class='object_link'><a href="EventMachine/AWS/Query/QueryError.html" title="EventMachine::AWS::Query::QueryError (class)">QueryError</a></span> &lt; Error<small class='search_info'>EventMachine::AWS::Query</small></li><li><span class='object_link'><a href="EventMachine/AWS/Query/QueryFailure.html" title="EventMachine::AWS::Query::QueryFailure (class)">QueryFailure</a></span> &lt; FailureResponse<small class='search_info'>EventMachine::AWS::Query</small></li><li><span class='object_link'><a href="EventMachine/AWS/Query/QueryParams.html" title="EventMachine::AWS::Query::QueryParams (module)">QueryParams</a></span><small class='search_info'>EventMachine::AWS::Query</small></li><li><span class='object_link'><a href="EventMachine/AWS/Query/QueryResponse.html" title="EventMachine::AWS::Query::QueryResponse (module)">QueryResponse</a></span><small class='search_info'>EventMachine::AWS::Query</small></li><li><span class='object_link'><a href="EventMachine/AWS/Query/QueryResult.html" title="EventMachine::AWS::Query::QueryResult (class)">QueryResult</a></span> &lt; SuccessResponse<small class='search_info'>EventMachine::AWS::Query</small></li><li><span class='object_link'><a href="EventMachine/AWS/Query/ResponseParser.html" title="EventMachine::AWS::Query::ResponseParser (class)">ResponseParser</a></span> &lt; Document<small class='search_info'>EventMachine::AWS::Query</small></li><li><span class='object_link'><a href="EventMachine/AWS/Query/SignatureV2.html" title="EventMachine::AWS::Query::SignatureV2 (class)">SignatureV2</a></span> &lt; Object<small class='search_info'>EventMachine::AWS::Query</small></li></ul><li><span class='object_link'><a href="EventMachine/AWS/Request.html" title="EventMachine::AWS::Request (class)">Request</a></span> &lt; Object<small class='search_info'>EventMachine::AWS</small></li><li><span class='object_link'><a href="EventMachine/AWS/Response.html" title="EventMachine::AWS::Response (class)">Response</a></span> &lt; Object<small class='search_info'>EventMachine::AWS</small></li><li><span class='object_link'><a href="EventMachine/AWS/SNS.html" title="EventMachine::AWS::SNS (class)">SNS</a></span> &lt; Service<small class='search_info'>EventMachine::AWS</small></li><li><span class='object_link'><a href="EventMachine/AWS/SQS.html" title="EventMachine::AWS::SQS (class)">SQS</a></span> &lt; Service<small class='search_info'>EventMachine::AWS</small></li><li><span class='object_link'><a href="EventMachine/AWS/Service.html" title="EventMachine::AWS::Service (class)">Service</a></span> &lt; Object<small class='search_info'>EventMachine::AWS</small></li><li><span class='object_link'><a href="EventMachine/AWS/SuccessResponse.html" title="EventMachine::AWS::SuccessResponse (class)">SuccessResponse</a></span> &lt; Response<small class='search_info'>EventMachine::AWS</small></li></ul></ul>
  42 +
43 43
44 44 </ul>
45 45 </div>
2  doc/file.README.html
@@ -224,7 +224,7 @@
224 224 </div></div>
225 225
226 226 <div id="footer">
227   - Generated on Sat Mar 3 14:35:09 2012 by
  227 + Generated on Mon Mar 5 19:27:16 2012 by
228 228 <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
229 229 0.7.5 (ruby-1.9.3).
230 230 </div>
3  doc/file_list.html
@@ -40,9 +40,6 @@ <h1 id="full_list_header">File List</h1>
40 40 <ul id="full_list" class="files">
41 41
42 42
43   - <li class="r1"><a href="index.html" title="README">README</a></li>
44   -
45   -
46 43 </ul>
47 44 </div>
48 45 </body>
189 doc/index.html
@@ -2,11 +2,9 @@
2 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 4 <head>
5   - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5 + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 6 <title>
7   - File: README
8   -
9   - &mdash; Documentation by YARD 0.7.5
  7 + Documentation by YARD 0.7.5
10 8
11 9 </title>
12 10
@@ -33,8 +31,8 @@
33 31 <div id="header">
34 32 <div id="menu">
35 33
36   - <a href="_index.html" title="Index">Index</a> &raquo;
37   - <span class="title">File: README</span>
  34 +
  35 + <span class="title"></span>
38 36
39 37
40 38 <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
@@ -54,177 +52,30 @@
54 52
55 53 <iframe id="search_frame"></iframe>
56 54
57   - <div id="content"><div id='filecontents'><h1>EventMachine::AWS</h1>
58   -
59   -<p><strong>EM::AWS</strong> is a thin Ruby wrapper for making calls to Amazon Web Services. It transparently signs requests, automatically retries on server errors, and unwraps XML responses into simple attributes. Unlike most other AWS libraries, it <em>does not</em> provide an object model for any of Amazon&#39;s services. It simply makes API calls and exposes the responses. Other gems or applications can build on this generic foundation to construct whatever higher-level model is appropriate for their needs.</p>
60   -
61   -<p>It also differs from other EventMachine libraries by offering a fully synchronous mode that <em>does not require</em> EventMachine to be running. (The method call simply starts and stops EM behind the scenes.) This mode is less efficient but makes it easier to use <strong>EM::AWS</strong> in non-evented frameworks such as Rails.</p>
62   -
63   -<p>At this stage in its development, <strong>EM::AWS</strong> supports the Amazon Query Protocol. This is the GET- or POST-based API framework used for virtually every Amazon service <em>except S3.</em> Support for S3&#39;s idiosyncratic REST API will likely come in a future release.</p>
64   -
65   -<h2>Getting Started</h2>
66   -
67   -<p>The <strong>em-aws</strong> gem is dependent on the <strong>eventmachine</strong>, <strong>em-http-request</strong>, and <strong>nokogiri</strong> gems. It was built and tested with Ruby 1.9, but should work with Rubinius and JRuby in 1.9 compatibility mode. <em>It will not work in Ruby 1.8.</em></p>
68   -
69   -<p>Once you&#39;ve added it to your Gemfile (or run <code>gem install em-aws</code>) you can supply the usual authentication credentials somewhere in your application&#39;s initialization:</p>
70   -
71   -<pre class="code ruby"><code><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>em-aws</span><span class='tstring_end'>'</span></span>
72   -
73   -<span class='const'>EM</span><span class='op'>::</span><span class='const'>AWS</span><span class='period'>.</span><span class='id identifier rubyid_aws_access_key_id'>aws_access_key_id</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>YOUR_ACCESS_KEY</span><span class='tstring_end'>'</span></span>
74   -<span class='const'>EM</span><span class='op'>::</span><span class='const'>AWS</span><span class='period'>.</span><span class='id identifier rubyid_aws_secret_access_key'>aws_secret_access_key</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>YOUR_SECRET_KEY</span><span class='tstring_end'>'</span></span>
75   -
76   -<span class='comment'># These global defaults can also be tweaked:
77   -</span><span class='comment'># EM::AWS.region = 'us-east-1'
78   -</span><span class='comment'># EM::AWS.ssl = true
79   -</span><span class='comment'># EM::AWS.retries = 10
80   -</span></code></pre>
81   -
82   -<p>If you don&#39;t want to supply your credentials globally, or need to use multiple identities in the same application, you can pass any of the above as options when constructing individual service objects:</p>
83   -
84   -<pre class="code ruby"><code><span class='comment'># Easiest way to hook to Simple Notification Service:
85   -</span><span class='id identifier rubyid_sns'>sns</span> <span class='op'>=</span> <span class='const'>EM</span><span class='op'>::</span><span class='const'>AWS</span><span class='op'>::</span><span class='const'>SNS</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
86   -
87   -<span class='comment'># The tricked-out version:
88   -</span><span class='id identifier rubyid_sns2'>sns2</span> <span class='op'>=</span> <span class='const'>EM</span><span class='op'>::</span><span class='const'>AWS</span><span class='op'>::</span><span class='const'>SNS</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>aws_access_key_id:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>OTHER_ACCESS_KEY</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
89   - <span class='label'>aws_secret_access_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>OTHER_SECRET_KEY</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
90   - <span class='label'>region:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ap-southeast-1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
91   - <span class='label'>ssl:</span> <span class='kw'>false</span><span class='comma'>,</span>
92   - <span class='label'>method:</span> <span class='symbol'>:get</span>
93   -</code></pre>
94   -
95   -<h2>Making Queries</h2>
96   -
97   -<p>To make any AWS request, simply create a service object of the appropriate class and then call the API action as a method using Ruby <em>snake_case</em> conventions. Pass parameters as a hash:</p>
98   -
99   -<pre class="code ruby"><code><span class='id identifier rubyid_sns'>sns</span> <span class='op'>=</span> <span class='const'>EM</span><span class='op'>::</span><span class='const'>AWS</span><span class='op'>::</span><span class='const'>SNS</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
100   -<span class='id identifier rubyid_request'>request</span> <span class='op'>=</span> <span class='id identifier rubyid_sns'>sns</span><span class='period'>.</span><span class='id identifier rubyid_create_topic'>create_topic</span> <span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>MyTestTopic</span><span class='tstring_end'>'</span></span>
101   -</code></pre>
102   -
103   -<p>The request object also receives and parses the response, and makes the returned values available as attributes or a hash:</p>
104   -
105   -<pre class="code ruby"><code><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_finished?'>finished?</span> <span class='comment'>#=&gt; true
106   -</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span> <span class='comment'>#=&gt; 200
107   -</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_topic_arn'>topic_arn</span> <span class='comment'>#=&gt; arn:aws:sns:us-east-1:123456789012:MyTestTopic
108   -</span><span class='id identifier rubyid_request'>request</span><span class='lbracket'>[</span><span class='symbol'>:topic_arn</span><span class='rbracket'>]</span> <span class='comment'>#=&gt; (same)
109   -</span><span class='id identifier rubyid_request'>request</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>TopicArn</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='comment'>#=&gt; (same)
110   -</span></code></pre>
111   -
112   -<p>The request can be passed a block, which -- if the request is successful -- receives the parsed response data and can act on it any way you like (in EventMachine terms, it becomes a <em>callback</em>):</p>
113   -
114   -<pre class="code ruby"><code><span class='comment'># Subscribe to the topic once created
115   -</span><span class='id identifier rubyid_sns'>sns</span><span class='period'>.</span><span class='id identifier rubyid_create_topic'>create_topic</span> <span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>MyTestTopic</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_response'>response</span><span class='op'>|</span>
116   - <span class='id identifier rubyid_sns'>sns</span><span class='period'>.</span><span class='id identifier rubyid_subscribe'>subscribe</span> <span class='label'>protocol:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>email</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>endpoint:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>myself@example.org</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
117   - <span class='label'>topic_arn:</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_topic_arn'>topic_arn</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_resp2'>resp2</span><span class='op'>|</span>
118   - <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Subscribed to topic </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_topic_arn'>topic_arn</span><span class='rbrace'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span>
119   - <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Your subscription ID is </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_resp2'>resp2</span><span class='period'>.</span><span class='id identifier rubyid_subscription_arn'>subscription_arn</span><span class='rbrace'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span>
120   - <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Check your email!</span><span class='tstring_end'>&quot;</span></span>
121   - <span class='kw'>end</span>
122   -<span class='kw'>end</span>
123   -</code></pre>
124   -
125   -<p>This single block usage works in both EventMachine and synchronous modes. (See below.) If you want to add more than one callback, or handle query failures in a similar way, you&#39;ll need to use EventMachine callbacks and errbacks.</p>
126   -
127   -<h2>Queries With EventMachine</h2>
128   -
129   -<p>In an evented <code>EM.run</code> loop, calling any query method will return the request object immediately. The <code>#finished?</code> attribute on the request will initially be <em>false</em>. The HTTP request will be made and the response received and parsed within the EventMachine loop, after which <code>#finished?</code> will be <em>true</em>. The <code>#success?</code> attribute will then be <em>true</em> if Amazon returned a successful response, or <em>false</em> if an error was received from Amazon.</p>
130   -
131   -<p>The <strong>Request</strong> object mixes in the <strong>EventMachine::Deferrable</strong> module, meaning you can attach blocks using the <code>#callback</code> and <code>#errback</code> methods. This is the primary means for evented programming with this gem. </p>
132   -
133   -<p>(<strong>Note:</strong> If your entire program is not intended to run within the EventMachine loop, you will have to call <code>EM.stop</code> explicitly when you&#39;re finished handling all requests. Don&#39;t forget to do so for both success and failure cases.)</p>
134   -
135   -<pre class="code ruby"><code><span class='const'>EM</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span> <span class='kw'>do</span>
136   - <span class='id identifier rubyid_request'>request</span> <span class='op'>=</span> <span class='id identifier rubyid_sns'>sns</span><span class='period'>.</span><span class='id identifier rubyid_create_topic'>create_topic</span> <span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>MyTopic</span><span class='tstring_end'>'</span></span>
137   -
138   - <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_callback'>callback</span> <span class=&#