magiclabs-userstamp 2.0.2
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.
- data/CHANGELOG +26 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +55 -0
- data/LICENSE +20 -0
- data/Rakefile +38 -0
- data/Readme.rdoc +163 -0
- data/VERSION +1 -0
- data/init.rb +1 -0
- data/lib/migration_helper.rb +19 -0
- data/lib/stampable.rb +154 -0
- data/lib/stamper.rb +43 -0
- data/lib/userstamp.rb +52 -0
- data/magiclabs-userstamp.gemspec +85 -0
- data/rdoc/classes/Ddb/Controller.html +111 -0
- data/rdoc/classes/Ddb/Controller/Userstamp.html +125 -0
- data/rdoc/classes/Ddb/Controller/Userstamp/InstanceMethods.html +105 -0
- data/rdoc/classes/Ddb/Userstamp.html +121 -0
- data/rdoc/classes/Ddb/Userstamp/MigrationHelper.html +111 -0
- data/rdoc/classes/Ddb/Userstamp/MigrationHelper/InstanceMethods.html +142 -0
- data/rdoc/classes/Ddb/Userstamp/Stampable.html +128 -0
- data/rdoc/classes/Ddb/Userstamp/Stampable/ClassMethods.html +225 -0
- data/rdoc/classes/Ddb/Userstamp/Stamper.html +112 -0
- data/rdoc/classes/Ddb/Userstamp/Stamper/ClassMethods.html +142 -0
- data/rdoc/classes/Ddb/Userstamp/Stamper/InstanceMethods.html +207 -0
- data/rdoc/classes/Userstamp.html +118 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/CHANGELOG.html +137 -0
- data/rdoc/files/LICENSE.html +129 -0
- data/rdoc/files/Readme_rdoc.html +301 -0
- data/rdoc/files/lib/migration_helper_rb.html +101 -0
- data/rdoc/files/lib/stampable_rb.html +101 -0
- data/rdoc/files/lib/stamper_rb.html +101 -0
- data/rdoc/files/lib/userstamp_rb.html +110 -0
- data/rdoc/fr_class_index.html +38 -0
- data/rdoc/fr_file_index.html +33 -0
- data/rdoc/fr_method_index.html +33 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/test/compatibility_stamping_test.rb +69 -0
- data/test/controllers/posts_controller.rb +26 -0
- data/test/controllers/users_controller.rb +12 -0
- data/test/controllers/userstamp_controller.rb +9 -0
- data/test/helper.rb +61 -0
- data/test/models/comment.rb +5 -0
- data/test/models/foo.rb +3 -0
- data/test/models/person.rb +3 -0
- data/test/models/post.rb +13 -0
- data/test/models/user.rb +3 -0
- data/test/schema.rb +54 -0
- data/test/stamping_test.rb +138 -0
- data/test/userstamp_controller_test.rb +103 -0
- data/test/userstamp_test.rb +7 -0
- metadata +105 -0
@@ -0,0 +1,225 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
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: Ddb::Userstamp::Stampable::ClassMethods</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
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">Ddb::Userstamp::Stampable::ClassMethods</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../../files/lib/stampable_rb.html">
|
59
|
+
lib/stampable.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000005">stampable</a>
|
84
|
+
<a href="#M000006">without_stamps</a>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
<!-- if includes -->
|
92
|
+
|
93
|
+
<div id="section">
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<!-- if method_list -->
|
103
|
+
<div id="methods">
|
104
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
105
|
+
|
106
|
+
<div id="method-M000005" class="method-detail">
|
107
|
+
<a name="M000005"></a>
|
108
|
+
|
109
|
+
<div class="method-heading">
|
110
|
+
<a href="#M000005" class="method-signature">
|
111
|
+
<span class="method-name">stampable</span><span class="method-args">(options = {})</span>
|
112
|
+
</a>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<div class="method-description">
|
116
|
+
<p>
|
117
|
+
This method is automatically called on for all classes that inherit from
|
118
|
+
ActiveRecord, but if you need to customize how the plug-in functions, this
|
119
|
+
is the method to use. Here‘s an example:
|
120
|
+
</p>
|
121
|
+
<pre>
|
122
|
+
class Post < ActiveRecord::Base
|
123
|
+
stampable :stamper_class_name => :person,
|
124
|
+
:creator_attribute => :create_user,
|
125
|
+
:updater_attribute => :update_user,
|
126
|
+
:deleter_attribute => :delete_user
|
127
|
+
:deleter => true
|
128
|
+
end
|
129
|
+
</pre>
|
130
|
+
<p>
|
131
|
+
The method will automatically setup all the associations, and create
|
132
|
+
<tt>before_save</tt> and <tt>before_create</tt> filters for doing the
|
133
|
+
stamping. By default, the deleter association and before filter are not
|
134
|
+
defined unless you are using acts_as_paranoid or you set the
|
135
|
+
:deleter_attribute or set the :deleter option to true.
|
136
|
+
</p>
|
137
|
+
<p><a class="source-toggle" href="#"
|
138
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
139
|
+
<div class="method-source-code" id="M000005-source">
|
140
|
+
<pre>
|
141
|
+
<span class="ruby-comment cmt"># File lib/stampable.rb, line 71</span>
|
142
|
+
71: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stampable</span>(<span class="ruby-identifier">options</span> = {})
|
143
|
+
72: <span class="ruby-identifier">compatability</span> = <span class="ruby-constant">Ddb</span><span class="ruby-operator">::</span><span class="ruby-constant">Userstamp</span>.<span class="ruby-identifier">compatibility_mode</span>
|
144
|
+
73: <span class="ruby-identifier">defaults</span> = {
|
145
|
+
74: <span class="ruby-identifier">:stamper_class_name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">:user</span>,
|
146
|
+
75: <span class="ruby-identifier">:creator_attribute</span> =<span class="ruby-operator">></span> (<span class="ruby-identifier">compatability</span> <span class="ruby-value">? </span><span class="ruby-operator">:</span><span class="ruby-identifier">created_by</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">:creator_id</span>),
|
147
|
+
76: <span class="ruby-identifier">:updater_attribute</span> =<span class="ruby-operator">></span> (<span class="ruby-identifier">compatability</span> <span class="ruby-value">? </span><span class="ruby-operator">:</span><span class="ruby-identifier">updated_by</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">:updater_id</span>),
|
148
|
+
77: <span class="ruby-identifier">:deleter_attribute</span> =<span class="ruby-operator">></span> (<span class="ruby-identifier">compatability</span> <span class="ruby-value">? </span><span class="ruby-operator">:</span><span class="ruby-identifier">deleted_by</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">:deleter_id</span>),
|
149
|
+
78: <span class="ruby-identifier">:deleter</span> =<span class="ruby-operator">></span> <span class="ruby-operator">!</span><span class="ruby-operator">!</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">:deleter_attribute</span>) <span class="ruby-keyword kw">or</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>))
|
150
|
+
79: }.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
|
151
|
+
80:
|
152
|
+
81: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">stamper_class_name</span> = <span class="ruby-identifier">defaults</span>[<span class="ruby-identifier">:stamper_class_name</span>].<span class="ruby-identifier">to_sym</span>
|
153
|
+
82: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">creator_attribute</span> = <span class="ruby-identifier">defaults</span>[<span class="ruby-identifier">:creator_attribute</span>].<span class="ruby-identifier">to_sym</span>
|
154
|
+
83: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">updater_attribute</span> = <span class="ruby-identifier">defaults</span>[<span class="ruby-identifier">:updater_attribute</span>].<span class="ruby-identifier">to_sym</span>
|
155
|
+
84: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">deleter_attribute</span> = <span class="ruby-identifier">defaults</span>[<span class="ruby-identifier">:deleter_attribute</span>].<span class="ruby-identifier">to_sym</span>
|
156
|
+
85:
|
157
|
+
86: <span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span>
|
158
|
+
87: <span class="ruby-identifier">klass</span> = <span class="ruby-identifier">stamper_class_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">singularize</span>.<span class="ruby-identifier">camelize</span>
|
159
|
+
88: <span class="ruby-identifier">belongs_to</span> <span class="ruby-identifier">:creator</span>, <span class="ruby-identifier">:class_name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">:foreign_key</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">creator_attribute</span>
|
160
|
+
89: <span class="ruby-identifier">belongs_to</span> <span class="ruby-identifier">:updater</span>, <span class="ruby-identifier">:class_name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">:foreign_key</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">updater_attribute</span>
|
161
|
+
90:
|
162
|
+
91: <span class="ruby-identifier">before_save</span> <span class="ruby-identifier">:set_updater_attribute</span>
|
163
|
+
92: <span class="ruby-identifier">before_create</span> <span class="ruby-identifier">:set_creator_attribute</span>
|
164
|
+
93:
|
165
|
+
94: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">defaults</span>[<span class="ruby-identifier">:deleter</span>]
|
166
|
+
95: <span class="ruby-identifier">belongs_to</span> <span class="ruby-identifier">:deleter</span>, <span class="ruby-identifier">:class_name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">:foreign_key</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">deleter_attribute</span>
|
167
|
+
96: <span class="ruby-identifier">before_destroy</span> <span class="ruby-identifier">:set_deleter_attribute</span>
|
168
|
+
97: <span class="ruby-keyword kw">end</span>
|
169
|
+
98: <span class="ruby-keyword kw">end</span>
|
170
|
+
99: <span class="ruby-keyword kw">end</span>
|
171
|
+
</pre>
|
172
|
+
</div>
|
173
|
+
</div>
|
174
|
+
</div>
|
175
|
+
|
176
|
+
<div id="method-M000006" class="method-detail">
|
177
|
+
<a name="M000006"></a>
|
178
|
+
|
179
|
+
<div class="method-heading">
|
180
|
+
<a href="#M000006" class="method-signature">
|
181
|
+
<span class="method-name">without_stamps</span><span class="method-args">() {|| ...}</span>
|
182
|
+
</a>
|
183
|
+
</div>
|
184
|
+
|
185
|
+
<div class="method-description">
|
186
|
+
<p>
|
187
|
+
Temporarily allows you to turn stamping off. For example:
|
188
|
+
</p>
|
189
|
+
<pre>
|
190
|
+
Post.without_stamps do
|
191
|
+
post = Post.find(params[:id])
|
192
|
+
post.update_attributes(params[:post])
|
193
|
+
post.save
|
194
|
+
end
|
195
|
+
</pre>
|
196
|
+
<p><a class="source-toggle" href="#"
|
197
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
198
|
+
<div class="method-source-code" id="M000006-source">
|
199
|
+
<pre>
|
200
|
+
<span class="ruby-comment cmt"># File lib/stampable.rb, line 108</span>
|
201
|
+
108: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">without_stamps</span>
|
202
|
+
109: <span class="ruby-identifier">original_value</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">record_userstamp</span>
|
203
|
+
110: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">record_userstamp</span> = <span class="ruby-keyword kw">false</span>
|
204
|
+
111: <span class="ruby-keyword kw">yield</span>
|
205
|
+
112: <span class="ruby-keyword kw">ensure</span>
|
206
|
+
113: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">record_userstamp</span> = <span class="ruby-identifier">original_value</span>
|
207
|
+
114: <span class="ruby-keyword kw">end</span>
|
208
|
+
</pre>
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
|
214
|
+
</div>
|
215
|
+
|
216
|
+
|
217
|
+
</div>
|
218
|
+
|
219
|
+
|
220
|
+
<div id="validator-badges">
|
221
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
222
|
+
</div>
|
223
|
+
|
224
|
+
</body>
|
225
|
+
</html>
|
@@ -0,0 +1,112 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
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: Ddb::Userstamp::Stamper</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
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">Ddb::Userstamp::Stamper</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/stamper_rb.html">
|
59
|
+
lib/stamper.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
|
83
|
+
<!-- if includes -->
|
84
|
+
|
85
|
+
<div id="section">
|
86
|
+
|
87
|
+
<div id="class-list">
|
88
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
89
|
+
|
90
|
+
Module <a href="Stamper/ClassMethods.html" class="link">Ddb::Userstamp::Stamper::ClassMethods</a><br />
|
91
|
+
Module <a href="Stamper/InstanceMethods.html" class="link">Ddb::Userstamp::Stamper::InstanceMethods</a><br />
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<!-- if method_list -->
|
102
|
+
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
<div id="validator-badges">
|
108
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
</body>
|
112
|
+
</html>
|
@@ -0,0 +1,142 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
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: Ddb::Userstamp::Stamper::ClassMethods</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
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">Ddb::Userstamp::Stamper::ClassMethods</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../../files/lib/stamper_rb.html">
|
59
|
+
lib/stamper.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000001">model_stamper</a>
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
<!-- if includes -->
|
91
|
+
|
92
|
+
<div id="section">
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<!-- if method_list -->
|
102
|
+
<div id="methods">
|
103
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
104
|
+
|
105
|
+
<div id="method-M000001" class="method-detail">
|
106
|
+
<a name="M000001"></a>
|
107
|
+
|
108
|
+
<div class="method-heading">
|
109
|
+
<a href="#M000001" class="method-signature">
|
110
|
+
<span class="method-name">model_stamper</span><span class="method-args">()</span>
|
111
|
+
</a>
|
112
|
+
</div>
|
113
|
+
|
114
|
+
<div class="method-description">
|
115
|
+
<p><a class="source-toggle" href="#"
|
116
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
117
|
+
<div class="method-source-code" id="M000001-source">
|
118
|
+
<pre>
|
119
|
+
<span class="ruby-comment cmt"># File lib/stamper.rb, line 9</span>
|
120
|
+
9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">model_stamper</span>
|
121
|
+
10: <span class="ruby-comment cmt"># don't allow multiple calls</span>
|
122
|
+
11: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included_modules</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">Ddb</span><span class="ruby-operator">::</span><span class="ruby-constant">Userstamp</span><span class="ruby-operator">::</span><span class="ruby-constant">Stamper</span><span class="ruby-operator">::</span><span class="ruby-constant">InstanceMethods</span>)
|
123
|
+
12: <span class="ruby-identifier">send</span>(<span class="ruby-identifier">:extend</span>, <span class="ruby-constant">Ddb</span><span class="ruby-operator">::</span><span class="ruby-constant">Userstamp</span><span class="ruby-operator">::</span><span class="ruby-constant">Stamper</span><span class="ruby-operator">::</span><span class="ruby-constant">InstanceMethods</span>)
|
124
|
+
13: <span class="ruby-keyword kw">end</span>
|
125
|
+
</pre>
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
<div id="validator-badges">
|
138
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
</body>
|
142
|
+
</html>
|