riaction 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. data/.yardoc/checksums +11 -0
  2. data/.yardoc/objects/root.dat +0 -0
  3. data/.yardoc/proxy_types +0 -0
  4. data/CHANGELOG.md +5 -0
  5. data/Gemfile.lock +12 -8
  6. data/README.md +6 -1
  7. data/db/riaction.db +0 -0
  8. data/doc/Riaction/ConfigurationError.html +116 -0
  9. data/doc/Riaction/Constants.html +389 -0
  10. data/doc/Riaction/CrudEventCallback.html +402 -0
  11. data/doc/Riaction/EventPerformer.html +250 -0
  12. data/doc/Riaction/NoEventDefined.html +116 -0
  13. data/doc/Riaction/NoProfileDefined.html +116 -0
  14. data/doc/Riaction/ProfileCreationCallback.html +192 -0
  15. data/doc/Riaction/ProfileCreator.html +235 -0
  16. data/doc/Riaction/Railtie.html +116 -0
  17. data/doc/Riaction/Riaction/ClassMethods.html +837 -0
  18. data/doc/Riaction/Riaction/Event/InstanceMethods.html +301 -0
  19. data/doc/Riaction/Riaction/Event.html +108 -0
  20. data/doc/Riaction/Riaction/InstanceMethods.html +198 -0
  21. data/doc/Riaction/Riaction/Profile/InstanceMethods.html +746 -0
  22. data/doc/Riaction/Riaction/Profile.html +108 -0
  23. data/doc/Riaction/Riaction.html +125 -0
  24. data/doc/Riaction/RuntimeError.html +116 -0
  25. data/doc/Riaction.html +124 -0
  26. data/doc/RiactionGenerator.html +188 -0
  27. data/doc/_index.html +263 -0
  28. data/doc/class_list.html +47 -0
  29. data/doc/css/common.css +1 -0
  30. data/doc/css/full_list.css +55 -0
  31. data/doc/css/style.css +322 -0
  32. data/doc/file.README.html +304 -0
  33. data/doc/file_list.html +49 -0
  34. data/doc/frames.html +13 -0
  35. data/doc/index.html +304 -0
  36. data/doc/js/app.js +205 -0
  37. data/doc/js/full_list.js +173 -0
  38. data/doc/js/jquery.js +16 -0
  39. data/doc/method_list.html +294 -0
  40. data/doc/top-level-namespace.html +107 -0
  41. data/lib/riaction/constants.rb +6 -2
  42. data/lib/riaction/crud_event_callback.rb +3 -0
  43. data/lib/riaction/event_performer.rb +10 -5
  44. data/lib/riaction/profile_creation_callback.rb +2 -0
  45. data/lib/riaction/riaction.rb +11 -7
  46. data/lib/riaction/version.rb +1 -1
  47. data/lib/tasks/riaction.rake +25 -22
  48. data/riaction.gemspec +4 -2
  49. data/spec/event_performer_spec.rb +23 -0
  50. data/spec/riaction_spec.rb +33 -4
  51. metadata +79 -19
@@ -0,0 +1,116 @@
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
+ Exception: Riaction::NoEventDefined
8
+
9
+ &mdash; Documentation by YARD 0.7.5
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
+ relpath = '..';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
25
+
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>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="../_index.html">Index (N)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../Riaction.html" title="Riaction (module)">Riaction</a></span></span>
38
+ &raquo;
39
+ <span class="title">NoEventDefined</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Exception: Riaction::NoEventDefined
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">StandardError</span>
70
+
71
+ <ul class="fullTree">
72
+ <li>Object</li>
73
+
74
+ <li class="next">StandardError</li>
75
+
76
+ <li class="next">Riaction::NoEventDefined</li>
77
+
78
+ </ul>
79
+ <a href="#" class="inheritanceTree">show all</a>
80
+
81
+ </dd>
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+ <dt class="r2 last">Defined in:</dt>
92
+ <dd class="r2 last">lib/riaction/riaction.rb</dd>
93
+
94
+ </dl>
95
+ <div class="clear"></div>
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+ </div>
108
+
109
+ <div id="footer">
110
+ Generated on Tue Mar 6 22:00:20 2012 by
111
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
112
+ 0.7.5 (ruby-1.9.3).
113
+ </div>
114
+
115
+ </body>
116
+ </html>
@@ -0,0 +1,116 @@
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
+ Exception: Riaction::NoProfileDefined
8
+
9
+ &mdash; Documentation by YARD 0.7.5
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
+ relpath = '..';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
25
+
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>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="../_index.html">Index (N)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../Riaction.html" title="Riaction (module)">Riaction</a></span></span>
38
+ &raquo;
39
+ <span class="title">NoProfileDefined</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Exception: Riaction::NoProfileDefined
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">StandardError</span>
70
+
71
+ <ul class="fullTree">
72
+ <li>Object</li>
73
+
74
+ <li class="next">StandardError</li>
75
+
76
+ <li class="next">Riaction::NoProfileDefined</li>
77
+
78
+ </ul>
79
+ <a href="#" class="inheritanceTree">show all</a>
80
+
81
+ </dd>
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+ <dt class="r2 last">Defined in:</dt>
92
+ <dd class="r2 last">lib/riaction/riaction.rb</dd>
93
+
94
+ </dl>
95
+ <div class="clear"></div>
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+ </div>
108
+
109
+ <div id="footer">
110
+ Generated on Tue Mar 6 22:00:20 2012 by
111
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
112
+ 0.7.5 (ruby-1.9.3).
113
+ </div>
114
+
115
+ </body>
116
+ </html>
@@ -0,0 +1,192 @@
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: Riaction::ProfileCreationCallback
8
+
9
+ &mdash; Documentation by YARD 0.7.5
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
+ relpath = '..';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
25
+
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>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="../_index.html">Index (P)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../Riaction.html" title="Riaction (module)">Riaction</a></span></span>
38
+ &raquo;
39
+ <span class="title">ProfileCreationCallback</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Class: Riaction::ProfileCreationCallback
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">Riaction::ProfileCreationCallback</li>
75
+
76
+ </ul>
77
+ <a href="#" class="inheritanceTree">show all</a>
78
+
79
+ </dd>
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ <dt class="r2 last">Defined in:</dt>
90
+ <dd class="r2 last">lib/riaction/profile_creation_callback.rb</dd>
91
+
92
+ </dl>
93
+ <div class="clear"></div>
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ <h2>
104
+ Instance Method Summary
105
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
106
+ </h2>
107
+
108
+ <ul class="summary">
109
+
110
+ <li class="public ">
111
+ <span class="summary_signature">
112
+
113
+ <a href="#after_create-instance_method" title="#after_create (instance method)">- (Object) <strong>after_create</strong>(record) </a>
114
+
115
+
116
+
117
+ </span>
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+ <span class="summary_desc"><div class='inline'>
127
+ <p>Enqueue a Riaction::ProfileCreatore object in resque.</p>
128
+ </div></span>
129
+
130
+ </li>
131
+
132
+
133
+ </ul>
134
+
135
+
136
+
137
+
138
+ <div id="instance_method_details" class="method_details_list">
139
+ <h2>Instance Method Details</h2>
140
+
141
+
142
+ <div class="method_details first">
143
+ <p class="signature first" id="after_create-instance_method">
144
+
145
+ - (<tt>Object</tt>) <strong>after_create</strong>(record)
146
+
147
+
148
+
149
+ </p><div class="docstring">
150
+ <div class="discussion">
151
+
152
+ <p>Enqueue a Riaction::ProfileCreatore object in resque</p>
153
+
154
+
155
+ </div>
156
+ </div>
157
+ <div class="tags">
158
+
159
+
160
+ </div><table class="source_code">
161
+ <tr>
162
+ <td>
163
+ <pre class="lines">
164
+
165
+
166
+ 8
167
+ 9
168
+ 10</pre>
169
+ </td>
170
+ <td>
171
+ <pre class="code"><span class="info file"># File 'lib/riaction/profile_creation_callback.rb', line 8</span>
172
+
173
+ <span class='kw'>def</span> <span class='id identifier rubyid_after_create'>after_create</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='rparen'>)</span>
174
+ <span class='const'>Resque</span><span class='period'>.</span><span class='id identifier rubyid_enqueue'>enqueue</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Riaction</span><span class='op'>::</span><span class='const'>ProfileCreator</span><span class='comma'>,</span> <span class='id identifier rubyid_record'>record</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_base_class'>base_class</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='id identifier rubyid_record'>record</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_record'>record</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_riactionless?'>riactionless?</span>
175
+ <span class='kw'>end</span></pre>
176
+ </td>
177
+ </tr>
178
+ </table>
179
+ </div>
180
+
181
+ </div>
182
+
183
+ </div>
184
+
185
+ <div id="footer">
186
+ Generated on Tue Mar 6 22:00:20 2012 by
187
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
188
+ 0.7.5 (ruby-1.9.3).
189
+ </div>
190
+
191
+ </body>
192
+ </html>
@@ -0,0 +1,235 @@
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: Riaction::ProfileCreator
8
+
9
+ &mdash; Documentation by YARD 0.7.5
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
+ relpath = '..';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
25
+
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>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="../_index.html">Index (P)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../Riaction.html" title="Riaction (module)">Riaction</a></span></span>
38
+ &raquo;
39
+ <span class="title">ProfileCreator</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Class: Riaction::ProfileCreator
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">Riaction::ProfileCreator</li>
75
+
76
+ </ul>
77
+ <a href="#" class="inheritanceTree">show all</a>
78
+
79
+ </dd>
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ <dt class="r2 last">Defined in:</dt>
90
+ <dd class="r2 last">lib/riaction/profile_creator.rb</dd>
91
+
92
+ </dl>
93
+ <div class="clear"></div>
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ <h2>
104
+ Class Method Summary
105
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
106
+ </h2>
107
+
108
+ <ul class="summary">
109
+
110
+ <li class="public ">
111
+ <span class="summary_signature">
112
+
113
+ <a href="#perform-class_method" title="perform (class method)">+ (Object) <strong>perform</strong>(klass_name, id, attempt = 0) </a>
114
+
115
+
116
+
117
+ </span>
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+ <span class="summary_desc"><div class='inline'></div></span>
127
+
128
+ </li>
129
+
130
+
131
+ </ul>
132
+
133
+
134
+
135
+
136
+ <div id="class_method_details" class="method_details_list">
137
+ <h2>Class Method Details</h2>
138
+
139
+
140
+ <div class="method_details first">
141
+ <p class="signature first" id="perform-class_method">
142
+
143
+ + (<tt>Object</tt>) <strong>perform</strong>(klass_name, id, attempt = 0)
144
+
145
+
146
+
147
+ </p><table class="source_code">
148
+ <tr>
149
+ <td>
150
+ <pre class="lines">
151
+
152
+
153
+ 8
154
+ 9
155
+ 10
156
+ 11
157
+ 12
158
+ 13
159
+ 14
160
+ 15
161
+ 16
162
+ 17
163
+ 18
164
+ 19
165
+ 20
166
+ 21
167
+ 22
168
+ 23
169
+ 24
170
+ 25
171
+ 26
172
+ 27
173
+ 28
174
+ 29
175
+ 30
176
+ 31
177
+ 32
178
+ 33
179
+ 34
180
+ 35
181
+ 36
182
+ 37
183
+ 38</pre>
184
+ </td>
185
+ <td>
186
+ <pre class="code"><span class="info file"># File 'lib/riaction/profile_creator.rb', line 8</span>
187
+
188
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span><span class='lparen'>(</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_attempt'>attempt</span><span class='op'>=</span><span class='int'>0</span><span class='rparen'>)</span>
189
+ <span class='kw'>if</span> <span class='id identifier rubyid_klass_name'>klass_name</span><span class='period'>.</span><span class='id identifier rubyid_constantize'>constantize</span><span class='period'>.</span><span class='id identifier rubyid_riactionary?'>riactionary?</span> <span class='op'>&amp;&amp;</span>
190
+ <span class='id identifier rubyid_klass_name'>klass_name</span><span class='period'>.</span><span class='id identifier rubyid_constantize'>constantize</span><span class='period'>.</span><span class='id identifier rubyid_riaction_profile?'>riaction_profile?</span> <span class='op'>&amp;&amp;</span>
191
+ <span class='id identifier rubyid_klass_name'>klass_name</span><span class='period'>.</span><span class='id identifier rubyid_constantize'>constantize</span><span class='period'>.</span><span class='id identifier rubyid_riaction_profile_types_defined'>riaction_profile_types_defined</span> <span class='op'>&gt;</span> <span class='int'>0</span>
192
+ <span class='id identifier rubyid_record'>record</span> <span class='op'>=</span> <span class='id identifier rubyid_klass_name'>klass_name</span><span class='period'>.</span><span class='id identifier rubyid_constantize'>constantize</span><span class='period'>.</span><span class='id identifier rubyid_find_by_id!'>find_by_id!</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
193
+ <span class='id identifier rubyid_iactionable_api'>iactionable_api</span> <span class='op'>=</span> <span class='const'>IActionable</span><span class='op'>::</span><span class='const'>Api</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
194
+ <span class='id identifier rubyid_record'>record</span><span class='period'>.</span><span class='id identifier rubyid_riaction_profile_keys'>riaction_profile_keys</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_profile_type'>profile_type</span><span class='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='op'>|</span>
195
+ <span class='id identifier rubyid_identifiers'>identifiers</span> <span class='op'>=</span> <span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
196
+ <span class='id identifier rubyid_first_defined'>first_defined</span> <span class='op'>=</span> <span class='id identifier rubyid_identifiers'>identifiers</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span>
197
+ <span class='id identifier rubyid_iactionable_api'>iactionable_api</span><span class='period'>.</span><span class='id identifier rubyid_create_profile'>create_profile</span><span class='lparen'>(</span><span class='id identifier rubyid_profile_type'>profile_type</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='id identifier rubyid_first_defined'>first_defined</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='id identifier rubyid_first_defined'>first_defined</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='id identifier rubyid_record'>record</span><span class='period'>.</span><span class='id identifier rubyid_riaction_set_profile'>riaction_set_profile</span><span class='lparen'>(</span><span class='id identifier rubyid_profile_type'>profile_type</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_riaction_profile_display_name'>riaction_profile_display_name</span> <span class='rparen'>)</span>
198
+ <span class='id identifier rubyid_identifiers'>identifiers</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_identifier'>identifier</span><span class='op'>|</span>
199
+ <span class='id identifier rubyid_iactionable_api'>iactionable_api</span><span class='period'>.</span><span class='id identifier rubyid_add_profile_identifier'>add_profile_identifier</span><span class='lparen'>(</span><span class='id identifier rubyid_profile_type'>profile_type</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='id identifier rubyid_first_defined'>first_defined</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='id identifier rubyid_first_defined'>first_defined</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='id identifier rubyid_identifier'>identifier</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='id identifier rubyid_identifier'>identifier</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span>
200
+ <span class='kw'>end</span>
201
+ <span class='kw'>end</span>
202
+ <span class='kw'>else</span>
203
+ <span class='id identifier rubyid_raise'>raise</span> <span class='op'>::</span><span class='const'>Riaction</span><span class='op'>::</span><span class='const'>RuntimeError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='rbrace'>}</span><span class='tstring_content'> does not define any riaction profiles</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
204
+ <span class='kw'>end</span>
205
+ <span class='kw'>rescue</span> <span class='const'>ActiveRecord</span><span class='op'>::</span><span class='const'>RecordNotFound</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
206
+ <span class='comment'># event_object no longer exists; no means to recover
207
+ </span><span class='kw'>rescue</span> <span class='const'>IActionable</span><span class='op'>::</span><span class='const'>Error</span><span class='op'>::</span><span class='const'>BadRequest</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
208
+ <span class='comment'># This should only be thrown if the profile type names specified in the model don't match what's on IActionable's dashboard
209
+ </span> <span class='id identifier rubyid_raise'>raise</span> <span class='id identifier rubyid_e'>e</span>
210
+ <span class='kw'>rescue</span> <span class='const'>IActionable</span><span class='op'>::</span><span class='const'>Error</span><span class='op'>::</span><span class='const'>Internal</span><span class='comma'>,</span> <span class='const'>Faraday</span><span class='op'>::</span><span class='const'>Error</span><span class='op'>::</span><span class='const'>TimeoutError</span><span class='comma'>,</span> <span class='const'>Timeout</span><span class='op'>::</span><span class='const'>Error</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
211
+ <span class='comment'># upon an intenal error from IActionable, retry some set number of times by requeueing the task through Resque
212
+ </span> <span class='comment'># after the max number of attempts, re-raise
213
+ </span> <span class='kw'>if</span> <span class='id identifier rubyid_attempt'>attempt</span> <span class='op'>&lt;</span> <span class='op'>::</span><span class='const'>Riaction</span><span class='op'>::</span><span class='const'>Constants</span><span class='period'>.</span><span class='id identifier rubyid_retry_attempts_for_internal_error'>retry_attempts_for_internal_error</span>
214
+ <span class='const'>Resque</span><span class='period'>.</span><span class='id identifier rubyid_enqueue'>enqueue</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_klass_name'>klass_name</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_attempt'>attempt</span><span class='op'>+</span><span class='int'>1</span><span class='rparen'>)</span>
215
+ <span class='kw'>else</span>
216
+ <span class='id identifier rubyid_raise'>raise</span> <span class='id identifier rubyid_e'>e</span>
217
+ <span class='kw'>end</span>
218
+ <span class='kw'>end</span></pre>
219
+ </td>
220
+ </tr>
221
+ </table>
222
+ </div>
223
+
224
+ </div>
225
+
226
+ </div>
227
+
228
+ <div id="footer">
229
+ Generated on Tue Mar 6 22:00:20 2012 by
230
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
231
+ 0.7.5 (ruby-1.9.3).
232
+ </div>
233
+
234
+ </body>
235
+ </html>