magic_userstamp 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +78 -8
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/init.rb +5 -7
- data/lib/magic_userstamp.rb +27 -0
- data/lib/{userstamp → magic_userstamp}/config.rb +11 -12
- data/lib/{userstamp → magic_userstamp}/controller.rb +2 -2
- data/lib/{userstamp → magic_userstamp}/event.rb +3 -3
- data/lib/{userstamp → magic_userstamp}/magic_columns.rb +3 -3
- data/lib/magic_userstamp/migration_helper.rb +17 -0
- data/lib/{userstamp → magic_userstamp}/stampable.rb +15 -15
- data/lib/{userstamp → magic_userstamp}/stamper.rb +5 -5
- data/magic_userstamp.gemspec +36 -29
- data/rdoc/classes/MagicUserstamp.html +233 -0
- data/rdoc/classes/MagicUserstamp/Config.html +408 -0
- data/rdoc/classes/MagicUserstamp/Config/Pattern.html +246 -0
- data/rdoc/classes/{Ddb → MagicUserstamp}/Controller.html +7 -7
- data/rdoc/classes/{Ddb/Controller/Userstamp → MagicUserstamp/Controller}/InstanceMethods.html +7 -7
- data/rdoc/classes/MagicUserstamp/Event.html +367 -0
- data/rdoc/classes/MagicUserstamp/MagicColumns.html +180 -0
- data/rdoc/classes/MagicUserstamp/MagicColumns/ClassMethods.html +225 -0
- data/rdoc/classes/MagicUserstamp/MagicUserstampError.html +111 -0
- data/rdoc/classes/{Ddb/Userstamp → MagicUserstamp}/MigrationHelper.html +8 -8
- data/rdoc/classes/MagicUserstamp/MigrationHelper/InstanceMethods.html +142 -0
- data/rdoc/classes/MagicUserstamp/Stampable.html +157 -0
- data/rdoc/classes/MagicUserstamp/Stampable/ClassMethods.html +259 -0
- data/rdoc/classes/{Ddb/Userstamp → MagicUserstamp}/Stamper.html +9 -9
- data/rdoc/classes/{Ddb/Userstamp → MagicUserstamp}/Stamper/ClassMethods.html +19 -19
- data/rdoc/classes/MagicUserstamp/Stamper/InstanceMethods.html +208 -0
- data/rdoc/created.rid +1 -1
- data/rdoc/files/README_rdoc.html +268 -0
- data/rdoc/files/lib/magic_userstamp/config_rb.html +108 -0
- data/rdoc/files/lib/magic_userstamp/controller_rb.html +108 -0
- data/rdoc/files/lib/{userstamp_rb.html → magic_userstamp/event_rb.html} +14 -7
- data/rdoc/files/lib/magic_userstamp/magic_columns_rb.html +108 -0
- data/rdoc/files/lib/{migration_helper_rb.html → magic_userstamp/migration_helper_rb.html} +12 -5
- data/rdoc/files/lib/magic_userstamp/stampable_rb.html +108 -0
- data/rdoc/files/lib/{stamper_rb.html → magic_userstamp/stamper_rb.html} +12 -5
- data/rdoc/files/lib/{stampable_rb.html → magic_userstamp_rb.html} +6 -6
- data/rdoc/fr_class_index.html +18 -13
- data/rdoc/fr_file_index.html +11 -9
- data/rdoc/fr_method_index.html +39 -9
- data/rdoc/index.html +7 -5
- data/spec/compatibility_stamping_spec.rb +3 -3
- data/spec/config_spec.rb +5 -5
- data/spec/magic_column_spec.rb +8 -8
- data/spec/resources/controllers/magic_userstamp_controller.rb +9 -0
- data/spec/resources/controllers/posts_controller.rb +2 -2
- data/spec/resources/controllers/users_controller.rb +2 -2
- data/spec/stamping_spec.rb +1 -1
- metadata +36 -29
- data/lib/userstamp.rb +0 -17
- data/lib/userstamp/migration_helper.rb +0 -17
- data/rdoc/classes/Ddb/Controller/Userstamp.html +0 -125
- data/rdoc/classes/Ddb/Userstamp.html +0 -121
- data/rdoc/classes/Ddb/Userstamp/MigrationHelper/InstanceMethods.html +0 -142
- data/rdoc/classes/Ddb/Userstamp/Stampable.html +0 -128
- data/rdoc/classes/Ddb/Userstamp/Stampable/ClassMethods.html +0 -222
- data/rdoc/classes/Ddb/Userstamp/Stamper/InstanceMethods.html +0 -207
- data/rdoc/files/CHANGELOG.html +0 -137
- data/rdoc/files/LICENSE.html +0 -129
- data/rdoc/files/README.html +0 -341
- data/spec/resources/controllers/userstamp_controller.rb +0 -9
@@ -0,0 +1,233 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: MagicUserstamp</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">MagicUserstamp</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/magic_userstamp/config_rb.html">
|
59
|
+
lib/magic_userstamp/config.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../files/lib/magic_userstamp/controller_rb.html">
|
63
|
+
lib/magic_userstamp/controller.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
<a href="../files/lib/magic_userstamp/event_rb.html">
|
67
|
+
lib/magic_userstamp/event.rb
|
68
|
+
</a>
|
69
|
+
<br />
|
70
|
+
<a href="../files/lib/magic_userstamp/magic_columns_rb.html">
|
71
|
+
lib/magic_userstamp/magic_columns.rb
|
72
|
+
</a>
|
73
|
+
<br />
|
74
|
+
<a href="../files/lib/magic_userstamp/migration_helper_rb.html">
|
75
|
+
lib/magic_userstamp/migration_helper.rb
|
76
|
+
</a>
|
77
|
+
<br />
|
78
|
+
<a href="../files/lib/magic_userstamp/stampable_rb.html">
|
79
|
+
lib/magic_userstamp/stampable.rb
|
80
|
+
</a>
|
81
|
+
<br />
|
82
|
+
<a href="../files/lib/magic_userstamp/stamper_rb.html">
|
83
|
+
lib/magic_userstamp/stamper.rb
|
84
|
+
</a>
|
85
|
+
<br />
|
86
|
+
<a href="../files/lib/magic_userstamp_rb.html">
|
87
|
+
lib/magic_userstamp.rb
|
88
|
+
</a>
|
89
|
+
<br />
|
90
|
+
</td>
|
91
|
+
</tr>
|
92
|
+
|
93
|
+
</table>
|
94
|
+
</div>
|
95
|
+
<!-- banner header -->
|
96
|
+
|
97
|
+
<div id="bodyContent">
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<div id="contextContent">
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
<div id="method-list">
|
108
|
+
<h3 class="section-bar">Methods</h3>
|
109
|
+
|
110
|
+
<div class="name-list">
|
111
|
+
<a href="#M000002">config</a>
|
112
|
+
<a href="#M000001">included</a>
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
</div>
|
117
|
+
|
118
|
+
|
119
|
+
<!-- if includes -->
|
120
|
+
<div id="includes">
|
121
|
+
<h3 class="section-bar">Included Modules</h3>
|
122
|
+
|
123
|
+
<div id="includes-list">
|
124
|
+
<span class="include-name"><a href="MagicUserstamp/Stampable.html">MagicUserstamp::Stampable</a></span>
|
125
|
+
<span class="include-name"><a href="MagicUserstamp/Stamper.html">MagicUserstamp::Stamper</a></span>
|
126
|
+
<span class="include-name"><a href="MagicUserstamp/MagicColumns.html">MagicUserstamp::MagicColumns</a></span>
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div id="section">
|
131
|
+
|
132
|
+
<div id="class-list">
|
133
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
134
|
+
|
135
|
+
Module <a href="MagicUserstamp/Controller.html" class="link">MagicUserstamp::Controller</a><br />
|
136
|
+
Module <a href="MagicUserstamp/MagicColumns.html" class="link">MagicUserstamp::MagicColumns</a><br />
|
137
|
+
Module <a href="MagicUserstamp/MigrationHelper.html" class="link">MagicUserstamp::MigrationHelper</a><br />
|
138
|
+
Module <a href="MagicUserstamp/Stampable.html" class="link">MagicUserstamp::Stampable</a><br />
|
139
|
+
Module <a href="MagicUserstamp/Stamper.html" class="link">MagicUserstamp::Stamper</a><br />
|
140
|
+
Class <a href="MagicUserstamp/Config.html" class="link">MagicUserstamp::Config</a><br />
|
141
|
+
Class <a href="MagicUserstamp/Event.html" class="link">MagicUserstamp::Event</a><br />
|
142
|
+
Class <a href="MagicUserstamp/MagicUserstampError.html" class="link">MagicUserstamp::MagicUserstampError</a><br />
|
143
|
+
|
144
|
+
</div>
|
145
|
+
|
146
|
+
<div id="constants-list">
|
147
|
+
<h3 class="section-bar">Constants</h3>
|
148
|
+
|
149
|
+
<div class="name-list">
|
150
|
+
<table summary="Constants">
|
151
|
+
<tr class="top-aligned-row context-row">
|
152
|
+
<td class="context-item-name">VALID_OPTIONS_KEYS_FOR_STAMPABLE_ON</td>
|
153
|
+
<td>=</td>
|
154
|
+
<td class="context-item-value">[ :attribute, # :column_name :stamper_name, :stamper_class_name, :stamper_attr_name, :attribute, :actual_hook</td>
|
155
|
+
</tr>
|
156
|
+
</table>
|
157
|
+
</div>
|
158
|
+
</div>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
<!-- if method_list -->
|
166
|
+
<div id="methods">
|
167
|
+
<h3 class="section-bar">Public Class methods</h3>
|
168
|
+
|
169
|
+
<div id="method-M000002" class="method-detail">
|
170
|
+
<a name="M000002"></a>
|
171
|
+
|
172
|
+
<div class="method-heading">
|
173
|
+
<a href="#M000002" class="method-signature">
|
174
|
+
<span class="method-name">config</span><span class="method-args">()</span>
|
175
|
+
</a>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
<div class="method-description">
|
179
|
+
<p><a class="source-toggle" href="#"
|
180
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
181
|
+
<div class="method-source-code" id="M000002-source">
|
182
|
+
<pre>
|
183
|
+
<span class="ruby-comment cmt"># File lib/magic_userstamp.rb, line 24</span>
|
184
|
+
24: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">config</span>
|
185
|
+
25: <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
|
186
|
+
26: <span class="ruby-keyword kw">end</span>
|
187
|
+
</pre>
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
</div>
|
191
|
+
|
192
|
+
<div id="method-M000001" class="method-detail">
|
193
|
+
<a name="M000001"></a>
|
194
|
+
|
195
|
+
<div class="method-heading">
|
196
|
+
<a href="#M000001" class="method-signature">
|
197
|
+
<span class="method-name">included</span><span class="method-args">(mod)</span>
|
198
|
+
</a>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div class="method-description">
|
202
|
+
<p><a class="source-toggle" href="#"
|
203
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
204
|
+
<div class="method-source-code" id="M000001-source">
|
205
|
+
<pre>
|
206
|
+
<span class="ruby-comment cmt"># File lib/magic_userstamp.rb, line 3</span>
|
207
|
+
3: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">mod</span>)
|
208
|
+
4: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mod</span> <span class="ruby-operator"><=</span> <span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
|
209
|
+
5: <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">module_eval</span> <span class="ruby-keyword kw">do</span>
|
210
|
+
6: <span class="ruby-identifier">include</span> <span class="ruby-constant">MagicUserstamp</span><span class="ruby-operator">::</span><span class="ruby-constant">Stampable</span>
|
211
|
+
7: <span class="ruby-identifier">include</span> <span class="ruby-constant">MagicUserstamp</span><span class="ruby-operator">::</span><span class="ruby-constant">Stamper</span>
|
212
|
+
8: <span class="ruby-identifier">include</span> <span class="ruby-constant">MagicUserstamp</span><span class="ruby-operator">::</span><span class="ruby-constant">MagicColumns</span> <span class="ruby-comment cmt"># mest be included after Userstamp::Stampable</span>
|
213
|
+
9: <span class="ruby-keyword kw">end</span>
|
214
|
+
10: <span class="ruby-keyword kw">end</span>
|
215
|
+
11: <span class="ruby-keyword kw">end</span>
|
216
|
+
</pre>
|
217
|
+
</div>
|
218
|
+
</div>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
|
222
|
+
</div>
|
223
|
+
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
|
228
|
+
<div id="validator-badges">
|
229
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
230
|
+
</div>
|
231
|
+
|
232
|
+
</body>
|
233
|
+
</html>
|
@@ -0,0 +1,408 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: MagicUserstamp::Config</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">MagicUserstamp::Config</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/magic_userstamp/config_rb.html">
|
59
|
+
lib/magic_userstamp/config.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000019">clear</a>
|
90
|
+
<a href="#M000025">compatibles</a>
|
91
|
+
<a href="#M000024">defaults</a>
|
92
|
+
<a href="#M000017">instance</a>
|
93
|
+
<a href="#M000020">new</a>
|
94
|
+
<a href="#M000023">on</a>
|
95
|
+
<a href="#M000022">pattern_for</a>
|
96
|
+
<a href="#M000021">setup</a>
|
97
|
+
<a href="#M000018">setup</a>
|
98
|
+
<a href="#M000026">verbose?</a>
|
99
|
+
</div>
|
100
|
+
</div>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
<!-- if includes -->
|
106
|
+
|
107
|
+
<div id="section">
|
108
|
+
|
109
|
+
<div id="class-list">
|
110
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
111
|
+
|
112
|
+
Class <a href="Config/Pattern.html" class="link">MagicUserstamp::Config::Pattern</a><br />
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<div id="attribute-list">
|
120
|
+
<h3 class="section-bar">Attributes</h3>
|
121
|
+
|
122
|
+
<div class="name-list">
|
123
|
+
<table>
|
124
|
+
<tr class="top-aligned-row context-row">
|
125
|
+
<td class="context-item-name">patterns</td>
|
126
|
+
<td class="context-item-value"> [R] </td>
|
127
|
+
<td class="context-item-desc"></td>
|
128
|
+
</tr>
|
129
|
+
<tr class="top-aligned-row context-row">
|
130
|
+
<td class="context-item-name">verbose</td>
|
131
|
+
<td class="context-item-value"> [RW] </td>
|
132
|
+
<td class="context-item-desc"></td>
|
133
|
+
</tr>
|
134
|
+
<tr class="top-aligned-row context-row">
|
135
|
+
<td class="context-item-name">with_destroy</td>
|
136
|
+
<td class="context-item-value"> [RW] </td>
|
137
|
+
<td class="context-item-desc"></td>
|
138
|
+
</tr>
|
139
|
+
</table>
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<!-- if method_list -->
|
146
|
+
<div id="methods">
|
147
|
+
<h3 class="section-bar">Public Class methods</h3>
|
148
|
+
|
149
|
+
<div id="method-M000019" class="method-detail">
|
150
|
+
<a name="M000019"></a>
|
151
|
+
|
152
|
+
<div class="method-heading">
|
153
|
+
<a href="#M000019" class="method-signature">
|
154
|
+
<span class="method-name">clear</span><span class="method-args">()</span>
|
155
|
+
</a>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<div class="method-description">
|
159
|
+
<p><a class="source-toggle" href="#"
|
160
|
+
onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
|
161
|
+
<div class="method-source-code" id="M000019-source">
|
162
|
+
<pre>
|
163
|
+
<span class="ruby-comment cmt"># File lib/magic_userstamp/config.rb, line 17</span>
|
164
|
+
17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear</span>
|
165
|
+
18: <span class="ruby-ivar">@instance</span> = <span class="ruby-keyword kw">nil</span>
|
166
|
+
19: <span class="ruby-keyword kw">end</span>
|
167
|
+
</pre>
|
168
|
+
</div>
|
169
|
+
</div>
|
170
|
+
</div>
|
171
|
+
|
172
|
+
<div id="method-M000017" class="method-detail">
|
173
|
+
<a name="M000017"></a>
|
174
|
+
|
175
|
+
<div class="method-heading">
|
176
|
+
<a href="#M000017" class="method-signature">
|
177
|
+
<span class="method-name">instance</span><span class="method-args">()</span>
|
178
|
+
</a>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<div class="method-description">
|
182
|
+
<p><a class="source-toggle" href="#"
|
183
|
+
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
184
|
+
<div class="method-source-code" id="M000017-source">
|
185
|
+
<pre>
|
186
|
+
<span class="ruby-comment cmt"># File lib/magic_userstamp/config.rb, line 9</span>
|
187
|
+
9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance</span>
|
188
|
+
10: <span class="ruby-ivar">@instance</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">new</span>
|
189
|
+
11: <span class="ruby-keyword kw">end</span>
|
190
|
+
</pre>
|
191
|
+
</div>
|
192
|
+
</div>
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<div id="method-M000020" class="method-detail">
|
196
|
+
<a name="M000020"></a>
|
197
|
+
|
198
|
+
<div class="method-heading">
|
199
|
+
<a href="#M000020" class="method-signature">
|
200
|
+
<span class="method-name">new</span><span class="method-args">()</span>
|
201
|
+
</a>
|
202
|
+
</div>
|
203
|
+
|
204
|
+
<div class="method-description">
|
205
|
+
<p><a class="source-toggle" href="#"
|
206
|
+
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
207
|
+
<div class="method-source-code" id="M000020-source">
|
208
|
+
<pre>
|
209
|
+
<span class="ruby-comment cmt"># File lib/magic_userstamp/config.rb, line 26</span>
|
210
|
+
26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
211
|
+
27: <span class="ruby-ivar">@patterns</span> = []
|
212
|
+
28: <span class="ruby-ivar">@with_destroy</span> = <span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">Caboose</span><span class="ruby-operator">::</span><span class="ruby-constant">Acts</span><span class="ruby-operator">::</span><span class="ruby-constant">Paranoid</span>)
|
213
|
+
29: <span class="ruby-keyword kw">end</span>
|
214
|
+
</pre>
|
215
|
+
</div>
|
216
|
+
</div>
|
217
|
+
</div>
|
218
|
+
|
219
|
+
<div id="method-M000018" class="method-detail">
|
220
|
+
<a name="M000018"></a>
|
221
|
+
|
222
|
+
<div class="method-heading">
|
223
|
+
<a href="#M000018" class="method-signature">
|
224
|
+
<span class="method-name">setup</span><span class="method-args">(&block)</span>
|
225
|
+
</a>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
<div class="method-description">
|
229
|
+
<p><a class="source-toggle" href="#"
|
230
|
+
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
231
|
+
<div class="method-source-code" id="M000018-source">
|
232
|
+
<pre>
|
233
|
+
<span class="ruby-comment cmt"># File lib/magic_userstamp/config.rb, line 13</span>
|
234
|
+
13: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
235
|
+
14: <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">setup</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
236
|
+
15: <span class="ruby-keyword kw">end</span>
|
237
|
+
</pre>
|
238
|
+
</div>
|
239
|
+
</div>
|
240
|
+
</div>
|
241
|
+
|
242
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
243
|
+
|
244
|
+
<div id="method-M000025" class="method-detail">
|
245
|
+
<a name="M000025"></a>
|
246
|
+
|
247
|
+
<div class="method-heading">
|
248
|
+
<a href="#M000025" class="method-signature">
|
249
|
+
<span class="method-name">compatibles</span><span class="method-args">(options = nil)</span>
|
250
|
+
</a>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<div class="method-description">
|
254
|
+
<p><a class="source-toggle" href="#"
|
255
|
+
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
256
|
+
<div class="method-source-code" id="M000025-source">
|
257
|
+
<pre>
|
258
|
+
<span class="ruby-comment cmt"># File lib/magic_userstamp/config.rb, line 52</span>
|
259
|
+
52: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compatibles</span>(<span class="ruby-identifier">options</span> = <span class="ruby-keyword kw">nil</span>)
|
260
|
+
53: <span class="ruby-identifier">on</span>(<span class="ruby-identifier">:create</span> , <span class="ruby-identifier">:created_by</span>, <span class="ruby-identifier">options</span>)
|
261
|
+
54: <span class="ruby-identifier">on</span>(<span class="ruby-identifier">:update</span> , <span class="ruby-identifier">:updated_by</span>, <span class="ruby-identifier">options</span>)
|
262
|
+
55: <span class="ruby-identifier">on</span>(<span class="ruby-identifier">:destroy</span>, <span class="ruby-identifier">:deleted_by</span>, <span class="ruby-identifier">options</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">with_destroy</span>
|
263
|
+
56: <span class="ruby-keyword kw">end</span>
|
264
|
+
</pre>
|
265
|
+
</div>
|
266
|
+
</div>
|
267
|
+
</div>
|
268
|
+
|
269
|
+
<div id="method-M000024" class="method-detail">
|
270
|
+
<a name="M000024"></a>
|
271
|
+
|
272
|
+
<div class="method-heading">
|
273
|
+
<a href="#M000024" class="method-signature">
|
274
|
+
<span class="method-name">defaults</span><span class="method-args">(options = nil)</span>
|
275
|
+
</a>
|
276
|
+
</div>
|
277
|
+
|
278
|
+
<div class="method-description">
|
279
|
+
<p><a class="source-toggle" href="#"
|
280
|
+
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
281
|
+
<div class="method-source-code" id="M000024-source">
|
282
|
+
<pre>
|
283
|
+
<span class="ruby-comment cmt"># File lib/magic_userstamp/config.rb, line 46</span>
|
284
|
+
46: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">defaults</span>(<span class="ruby-identifier">options</span> = <span class="ruby-keyword kw">nil</span>)
|
285
|
+
47: <span class="ruby-identifier">on</span>(<span class="ruby-identifier">:create</span> , <span class="ruby-identifier">:creator_id</span>, <span class="ruby-identifier">options</span>)
|
286
|
+
48: <span class="ruby-identifier">on</span>(<span class="ruby-identifier">:update</span> , <span class="ruby-identifier">:updater_id</span>, <span class="ruby-identifier">options</span>)
|
287
|
+
49: <span class="ruby-identifier">on</span>(<span class="ruby-identifier">:destroy</span>, <span class="ruby-identifier">:deleter_id</span>, <span class="ruby-identifier">options</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">with_destroy</span>
|
288
|
+
50: <span class="ruby-keyword kw">end</span>
|
289
|
+
</pre>
|
290
|
+
</div>
|
291
|
+
</div>
|
292
|
+
</div>
|
293
|
+
|
294
|
+
<div id="method-M000023" class="method-detail">
|
295
|
+
<a name="M000023"></a>
|
296
|
+
|
297
|
+
<div class="method-heading">
|
298
|
+
<a href="#M000023" class="method-signature">
|
299
|
+
<span class="method-name">on</span><span class="method-args">(event_name, column_name, options = nil)</span>
|
300
|
+
</a>
|
301
|
+
</div>
|
302
|
+
|
303
|
+
<div class="method-description">
|
304
|
+
<p><a class="source-toggle" href="#"
|
305
|
+
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
306
|
+
<div class="method-source-code" id="M000023-source">
|
307
|
+
<pre>
|
308
|
+
<span class="ruby-comment cmt"># File lib/magic_userstamp/config.rb, line 40</span>
|
309
|
+
40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">on</span>(<span class="ruby-identifier">event_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword kw">nil</span>)
|
310
|
+
41: <span class="ruby-identifier">result</span> = <span class="ruby-constant">Pattern</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">event_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">options</span>)
|
311
|
+
42: <span class="ruby-identifier">patterns</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">result</span>
|
312
|
+
43: <span class="ruby-identifier">result</span>
|
313
|
+
44: <span class="ruby-keyword kw">end</span>
|
314
|
+
</pre>
|
315
|
+
</div>
|
316
|
+
</div>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
<div id="method-M000022" class="method-detail">
|
320
|
+
<a name="M000022"></a>
|
321
|
+
|
322
|
+
<div class="method-heading">
|
323
|
+
<a href="#M000022" class="method-signature">
|
324
|
+
<span class="method-name">pattern_for</span><span class="method-args">(klass, column_name)</span>
|
325
|
+
</a>
|
326
|
+
</div>
|
327
|
+
|
328
|
+
<div class="method-description">
|
329
|
+
<p><a class="source-toggle" href="#"
|
330
|
+
onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
|
331
|
+
<div class="method-source-code" id="M000022-source">
|
332
|
+
<pre>
|
333
|
+
<span class="ruby-comment cmt"># File lib/magic_userstamp/config.rb, line 36</span>
|
334
|
+
36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pattern_for</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-identifier">column_name</span>)
|
335
|
+
37: <span class="ruby-identifier">patterns</span>.<span class="ruby-identifier">detect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pattern</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">stampable?</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-identifier">column_name</span>)}
|
336
|
+
38: <span class="ruby-keyword kw">end</span>
|
337
|
+
</pre>
|
338
|
+
</div>
|
339
|
+
</div>
|
340
|
+
</div>
|
341
|
+
|
342
|
+
<div id="method-M000021" class="method-detail">
|
343
|
+
<a name="M000021"></a>
|
344
|
+
|
345
|
+
<div class="method-heading">
|
346
|
+
<a href="#M000021" class="method-signature">
|
347
|
+
<span class="method-name">setup</span><span class="method-args">() {|self| ...}</span>
|
348
|
+
</a>
|
349
|
+
</div>
|
350
|
+
|
351
|
+
<div class="method-description">
|
352
|
+
<p><a class="source-toggle" href="#"
|
353
|
+
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
354
|
+
<div class="method-source-code" id="M000021-source">
|
355
|
+
<pre>
|
356
|
+
<span class="ruby-comment cmt"># File lib/magic_userstamp/config.rb, line 31</span>
|
357
|
+
31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
358
|
+
32: <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
359
|
+
33: <span class="ruby-keyword kw">self</span>
|
360
|
+
34: <span class="ruby-keyword kw">end</span>
|
361
|
+
</pre>
|
362
|
+
</div>
|
363
|
+
</div>
|
364
|
+
</div>
|
365
|
+
|
366
|
+
<div id="method-M000026" class="method-detail">
|
367
|
+
<a name="M000026"></a>
|
368
|
+
|
369
|
+
<div class="method-heading">
|
370
|
+
<a href="#M000026" class="method-signature">
|
371
|
+
<span class="method-name">verbose?</span><span class="method-args">(klass, column_name)</span>
|
372
|
+
</a>
|
373
|
+
</div>
|
374
|
+
|
375
|
+
<div class="method-description">
|
376
|
+
<p><a class="source-toggle" href="#"
|
377
|
+
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
378
|
+
<div class="method-source-code" id="M000026-source">
|
379
|
+
<pre>
|
380
|
+
<span class="ruby-comment cmt"># File lib/magic_userstamp/config.rb, line 58</span>
|
381
|
+
58: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">verbose?</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-identifier">column_name</span>)
|
382
|
+
59: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">verbose</span>
|
383
|
+
60: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Hash</span> <span class="ruby-keyword kw">then</span>
|
384
|
+
61: <span class="ruby-identifier">verbose_match?</span>(<span class="ruby-identifier">verbose</span>, <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">column_name</span>)
|
385
|
+
62: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Array</span> <span class="ruby-keyword kw">then</span>
|
386
|
+
63: <span class="ruby-identifier">verbose</span>.<span class="ruby-identifier">any?</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">setting</span><span class="ruby-operator">|</span> <span class="ruby-identifier">verbose_match?</span>(<span class="ruby-identifier">setting</span>, <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">column_name</span>)}
|
387
|
+
64: <span class="ruby-keyword kw">else</span>
|
388
|
+
65: <span class="ruby-operator">!</span><span class="ruby-operator">!</span><span class="ruby-identifier">verbose</span>
|
389
|
+
66: <span class="ruby-keyword kw">end</span>
|
390
|
+
67: <span class="ruby-keyword kw">end</span>
|
391
|
+
</pre>
|
392
|
+
</div>
|
393
|
+
</div>
|
394
|
+
</div>
|
395
|
+
|
396
|
+
|
397
|
+
</div>
|
398
|
+
|
399
|
+
|
400
|
+
</div>
|
401
|
+
|
402
|
+
|
403
|
+
<div id="validator-badges">
|
404
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
405
|
+
</div>
|
406
|
+
|
407
|
+
</body>
|
408
|
+
</html>
|