wpb 0.0.3 → 0.0.5
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.md +9 -3
- data/bin/wpb +3 -5
- data/doc/Bash.html +222 -0
- data/doc/Comment.html +411 -0
- data/doc/Gemfile.html +110 -0
- data/doc/Page.html +315 -0
- data/doc/PagePost.html +422 -0
- data/doc/Post.html +164 -0
- data/doc/Rakefile.html +107 -0
- data/doc/Setting.html +164 -0
- data/doc/User.html +415 -0
- data/doc/WPB.html +188 -0
- data/doc/WPB/AddType.html +254 -0
- data/doc/WPB/App.html +231 -0
- data/doc/bin/wpb.html +54 -0
- data/doc/created.rid +13 -0
- data/doc/index.html +114 -0
- data/doc/lib/wpb/bash_rb.html +56 -0
- data/doc/lib/wpb/comment_rb.html +54 -0
- data/doc/lib/wpb/page_rb.html +203 -0
- data/doc/lib/wpb/pagepost_rb.html +54 -0
- data/doc/lib/wpb/post_rb.html +52 -0
- data/doc/lib/wpb/setting_rb.html +54 -0
- data/doc/lib/wpb/user_rb.html +54 -0
- data/doc/lib/wpb/version_rb.html +52 -0
- data/doc/lib/wpb_rb.html +68 -0
- data/doc/rdoc.css +706 -0
- data/lib/wpb.rb +36 -29
- data/lib/wpb/bash.rb +18 -0
- data/lib/wpb/clamp/attribute.rb +37 -0
- data/lib/wpb/clamp/attribute_declaration.rb +40 -0
- data/lib/wpb/clamp/command.rb +137 -0
- data/lib/wpb/clamp/errors.rb +26 -0
- data/lib/wpb/clamp/help.rb +69 -0
- data/lib/wpb/clamp/option.rb +77 -0
- data/lib/wpb/clamp/option/declaration.rb +58 -0
- data/lib/wpb/clamp/option/parsing.rb +45 -0
- data/lib/wpb/clamp/parameter.rb +70 -0
- data/lib/wpb/clamp/parameter/declaration.rb +28 -0
- data/lib/wpb/clamp/parameter/parsing.rb +28 -0
- data/lib/wpb/clamp/subcommand.rb +23 -0
- data/lib/wpb/clamp/subcommand/declaration.rb +40 -0
- data/lib/wpb/clamp/subcommand/execution.rb +37 -0
- data/lib/wpb/clamp/version.rb +3 -0
- data/lib/wpb/comment.rb +51 -5
- data/lib/wpb/page.rb +46 -0
- data/lib/wpb/pagepost.rb +29 -16
- data/lib/wpb/user.rb +25 -0
- data/lib/wpb/version.rb +4 -1
- metadata +43 -2
data/Changelog.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
### Release 0.0.
|
3
|
+
### Release 0.0.4 - Not Released Yet
|
4
|
+
* 1 major feature
|
5
|
+
* Using clamp gem
|
6
|
+
* 1 minor feature
|
7
|
+
* Added `-v` and `--version` flags for executable
|
8
|
+
|
9
|
+
### Release 0.0.3 - 17th May
|
4
10
|
* 1 major feature
|
5
11
|
* Added comments support
|
6
12
|
* 3 minor features
|
@@ -13,12 +19,12 @@
|
|
13
19
|
* 1 depreciated
|
14
20
|
* `body` and `body=` in Page/Post models use `content` and `content=` instead (method removed completeley)
|
15
21
|
|
16
|
-
### Release 0.0.2
|
22
|
+
### Release 0.0.2 - 16th May
|
17
23
|
* 1 minor feature
|
18
24
|
* Added connection between the User and the Post/Page
|
19
25
|
* 1 major bug fix
|
20
26
|
* WordPress pages would break with inheritance issue
|
21
27
|
|
22
|
-
### Release 0.0.1
|
28
|
+
### Release 0.0.1 - Not Publicly Released
|
23
29
|
* 1 major feature
|
24
30
|
* Initial release
|
data/bin/wpb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
exec "#{irb} #{libs} -f --simple-prompt"
|
3
|
+
require "wpb/bash"
|
4
|
+
|
5
|
+
Bash.run
|
data/doc/Bash.html
ADDED
@@ -0,0 +1,222 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: Bash</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="./js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="./js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="class">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
27
|
+
<h3 class="section-header">
|
28
|
+
<a href="./index.html">Home</a>
|
29
|
+
<a href="./index.html#classes">Classes</a>
|
30
|
+
<a href="./index.html#methods">Methods</a>
|
31
|
+
</h3>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="file-metadata">
|
36
|
+
<div id="file-list-section" class="section">
|
37
|
+
<h3 class="section-header">In Files</h3>
|
38
|
+
<div class="section-body">
|
39
|
+
<ul>
|
40
|
+
|
41
|
+
<li><a href="./lib/wpb/bash_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lib/wpb/bash.rb">lib/wpb/bash.rb</a></li>
|
43
|
+
|
44
|
+
</ul>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div id="class-metadata">
|
52
|
+
|
53
|
+
<!-- Parent Class -->
|
54
|
+
|
55
|
+
<div id="parent-class-section" class="section">
|
56
|
+
<h3 class="section-header">Parent</h3>
|
57
|
+
|
58
|
+
<p class="link">Clamp::Command</p>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Namespace Contents -->
|
64
|
+
|
65
|
+
|
66
|
+
<!-- Method Quickref -->
|
67
|
+
|
68
|
+
<div id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
<ul class="link-list">
|
71
|
+
|
72
|
+
<li><a href="#method-i-execute">#execute</a></li>
|
73
|
+
|
74
|
+
</ul>
|
75
|
+
</div>
|
76
|
+
|
77
|
+
|
78
|
+
<!-- Included Modules -->
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
<div id="project-metadata">
|
83
|
+
|
84
|
+
|
85
|
+
<div id="fileindex-section" class="section project-section">
|
86
|
+
<h3 class="section-header">Files</h3>
|
87
|
+
<ul>
|
88
|
+
|
89
|
+
<li class="file"><a href="./Gemfile.html">Gemfile</a></li>
|
90
|
+
|
91
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a></li>
|
92
|
+
|
93
|
+
</ul>
|
94
|
+
</div>
|
95
|
+
|
96
|
+
|
97
|
+
<div id="classindex-section" class="section project-section">
|
98
|
+
<h3 class="section-header">Class Index
|
99
|
+
<span class="search-toggle"><img src="./images/find.png"
|
100
|
+
height="16" width="16" alt="[+]"
|
101
|
+
title="show/hide quicksearch" /></span></h3>
|
102
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
103
|
+
<fieldset>
|
104
|
+
<legend>Quicksearch</legend>
|
105
|
+
<input type="text" name="quicksearch" value=""
|
106
|
+
class="quicksearch-field" />
|
107
|
+
</fieldset>
|
108
|
+
</form>
|
109
|
+
|
110
|
+
<ul class="link-list">
|
111
|
+
|
112
|
+
<li><a href="./WPB.html">WPB</a></li>
|
113
|
+
|
114
|
+
<li><a href="./WPB/AddType.html">WPB::AddType</a></li>
|
115
|
+
|
116
|
+
<li><a href="./WPB/App.html">WPB::App</a></li>
|
117
|
+
|
118
|
+
<li><a href="./Bash.html">Bash</a></li>
|
119
|
+
|
120
|
+
<li><a href="./Comment.html">Comment</a></li>
|
121
|
+
|
122
|
+
<li><a href="./Page.html">Page</a></li>
|
123
|
+
|
124
|
+
<li><a href="./PagePost.html">PagePost</a></li>
|
125
|
+
|
126
|
+
<li><a href="./Post.html">Post</a></li>
|
127
|
+
|
128
|
+
<li><a href="./Setting.html">Setting</a></li>
|
129
|
+
|
130
|
+
<li><a href="./User.html">User</a></li>
|
131
|
+
|
132
|
+
</ul>
|
133
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<div id="documentation">
|
141
|
+
<h1 class="class">Bash</h1>
|
142
|
+
|
143
|
+
<div id="description">
|
144
|
+
|
145
|
+
</div>
|
146
|
+
|
147
|
+
<!-- Constants -->
|
148
|
+
|
149
|
+
|
150
|
+
<!-- Attributes -->
|
151
|
+
|
152
|
+
|
153
|
+
<!-- Methods -->
|
154
|
+
|
155
|
+
<div id="public-instance-method-details" class="method-section section">
|
156
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
157
|
+
|
158
|
+
|
159
|
+
<div id="execute-method" class="method-detail ">
|
160
|
+
<a name="method-i-execute"></a>
|
161
|
+
|
162
|
+
<div class="method-heading">
|
163
|
+
|
164
|
+
<span class="method-name">execute</span><span
|
165
|
+
class="method-args">()</span>
|
166
|
+
<span class="method-click-advice">click to toggle source</span>
|
167
|
+
|
168
|
+
</div>
|
169
|
+
|
170
|
+
<div class="method-description">
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
<div class="method-source-code"
|
177
|
+
id="execute-source">
|
178
|
+
<pre>
|
179
|
+
<span class="ruby-comment cmt"># File lib/wpb/bash.rb, line 6</span>
|
180
|
+
6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">execute</span>
|
181
|
+
7: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">version?</span>
|
182
|
+
8: <span class="ruby-identifier">require</span> <span class="ruby-value str">"wpb/version"</span>
|
183
|
+
9: <span class="ruby-identifier">print</span> <span class="ruby-node">"WordPress Bash #{WPB::VERSION} (c) James Birtles"</span>
|
184
|
+
10: <span class="ruby-keyword kw">else</span>
|
185
|
+
11: <span class="ruby-identifier">irb</span> = <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(:?mswin|mingw)/</span> <span class="ruby-operator">?</span> <span class="ruby-value str">'irb.bat'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'irb'</span>
|
186
|
+
12: <span class="ruby-identifier">libs</span> = <span class="ruby-value str">" -r irb/completion"</span>
|
187
|
+
13: <span class="ruby-identifier">libs</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" -r #{File.expand_path('../../wpb.rb', __FILE__)}"</span>
|
188
|
+
14: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"Connecting to database..."</span>
|
189
|
+
15: <span class="ruby-identifier">exec</span> <span class="ruby-node">"#{irb} #{libs}"</span>
|
190
|
+
16: <span class="ruby-keyword kw">end</span>
|
191
|
+
17: <span class="ruby-keyword kw">end</span></pre>
|
192
|
+
</div>
|
193
|
+
|
194
|
+
</div>
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
</div>
|
200
|
+
|
201
|
+
|
202
|
+
</div>
|
203
|
+
|
204
|
+
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
209
|
+
|
210
|
+
<p>Disabled; run with --debug to generate this.</p>
|
211
|
+
|
212
|
+
</div>
|
213
|
+
|
214
|
+
<div id="validator-badges">
|
215
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
216
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
217
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
</body>
|
221
|
+
</html>
|
222
|
+
|
data/doc/Comment.html
ADDED
@@ -0,0 +1,411 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: Comment</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="./js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="./js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="class">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
27
|
+
<h3 class="section-header">
|
28
|
+
<a href="./index.html">Home</a>
|
29
|
+
<a href="./index.html#classes">Classes</a>
|
30
|
+
<a href="./index.html#methods">Methods</a>
|
31
|
+
</h3>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="file-metadata">
|
36
|
+
<div id="file-list-section" class="section">
|
37
|
+
<h3 class="section-header">In Files</h3>
|
38
|
+
<div class="section-body">
|
39
|
+
<ul>
|
40
|
+
|
41
|
+
<li><a href="./lib/wpb/comment_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lib/wpb/comment.rb">lib/wpb/comment.rb</a></li>
|
43
|
+
|
44
|
+
</ul>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div id="class-metadata">
|
52
|
+
|
53
|
+
<!-- Parent Class -->
|
54
|
+
|
55
|
+
<div id="parent-class-section" class="section">
|
56
|
+
<h3 class="section-header">Parent</h3>
|
57
|
+
|
58
|
+
<p class="link">ActiveRecord::Base</p>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Namespace Contents -->
|
64
|
+
|
65
|
+
|
66
|
+
<!-- Method Quickref -->
|
67
|
+
|
68
|
+
<div id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
<ul class="link-list">
|
71
|
+
|
72
|
+
<li><a href="#method-i-content">#content</a></li>
|
73
|
+
|
74
|
+
<li><a href="#method-i-content%3D">#content=</a></li>
|
75
|
+
|
76
|
+
<li><a href="#method-i-set_default_values">#set_default_values</a></li>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
</div>
|
80
|
+
|
81
|
+
|
82
|
+
<!-- Included Modules -->
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<div id="project-metadata">
|
87
|
+
|
88
|
+
|
89
|
+
<div id="fileindex-section" class="section project-section">
|
90
|
+
<h3 class="section-header">Files</h3>
|
91
|
+
<ul>
|
92
|
+
|
93
|
+
<li class="file"><a href="./Gemfile.html">Gemfile</a></li>
|
94
|
+
|
95
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a></li>
|
96
|
+
|
97
|
+
</ul>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
<div id="classindex-section" class="section project-section">
|
102
|
+
<h3 class="section-header">Class Index
|
103
|
+
<span class="search-toggle"><img src="./images/find.png"
|
104
|
+
height="16" width="16" alt="[+]"
|
105
|
+
title="show/hide quicksearch" /></span></h3>
|
106
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
107
|
+
<fieldset>
|
108
|
+
<legend>Quicksearch</legend>
|
109
|
+
<input type="text" name="quicksearch" value=""
|
110
|
+
class="quicksearch-field" />
|
111
|
+
</fieldset>
|
112
|
+
</form>
|
113
|
+
|
114
|
+
<ul class="link-list">
|
115
|
+
|
116
|
+
<li><a href="./WPB.html">WPB</a></li>
|
117
|
+
|
118
|
+
<li><a href="./WPB/AddType.html">WPB::AddType</a></li>
|
119
|
+
|
120
|
+
<li><a href="./WPB/App.html">WPB::App</a></li>
|
121
|
+
|
122
|
+
<li><a href="./Bash.html">Bash</a></li>
|
123
|
+
|
124
|
+
<li><a href="./Comment.html">Comment</a></li>
|
125
|
+
|
126
|
+
<li><a href="./Page.html">Page</a></li>
|
127
|
+
|
128
|
+
<li><a href="./PagePost.html">PagePost</a></li>
|
129
|
+
|
130
|
+
<li><a href="./Post.html">Post</a></li>
|
131
|
+
|
132
|
+
<li><a href="./Setting.html">Setting</a></li>
|
133
|
+
|
134
|
+
<li><a href="./User.html">User</a></li>
|
135
|
+
|
136
|
+
</ul>
|
137
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</div>
|
143
|
+
|
144
|
+
<div id="documentation">
|
145
|
+
<h1 class="class">Comment</h1>
|
146
|
+
|
147
|
+
<div id="description">
|
148
|
+
<p>
|
149
|
+
This class is used for getting the comments from the wordpress database
|
150
|
+
</p>
|
151
|
+
<h2>Examples:</h2>
|
152
|
+
<pre>
|
153
|
+
User.find(1).comments
|
154
|
+
</pre>
|
155
|
+
<p>
|
156
|
+
<em>The above will find the user with id of 1 and retrieve all of the
|
157
|
+
comments they have ever made</em>
|
158
|
+
</p>
|
159
|
+
<pre>
|
160
|
+
Post.find(1).comments
|
161
|
+
</pre>
|
162
|
+
<p>
|
163
|
+
<em>The above will find the post with id of 1 and retrieve all of the
|
164
|
+
comments from that post</em>
|
165
|
+
</p>
|
166
|
+
<pre>
|
167
|
+
Comment.find(1)
|
168
|
+
</pre>
|
169
|
+
<p>
|
170
|
+
<em>The above will find the comment with id of 1</em>
|
171
|
+
</p>
|
172
|
+
<h2>Inherited methods</h2>
|
173
|
+
<dl>
|
174
|
+
<dt>find <em>id</em></dt><dd><p>
|
175
|
+
Retrieves the comment with the sepcified id
|
176
|
+
</p>
|
177
|
+
</dd>
|
178
|
+
<dt>all</dt><dd><p>
|
179
|
+
Retrieves all of the comments in the database
|
180
|
+
</p>
|
181
|
+
</dd>
|
182
|
+
</dl>
|
183
|
+
<h2>Database Keys</h2>
|
184
|
+
<dl>
|
185
|
+
<dt>comment_ID <em>alias: id</em></dt><dd><p>
|
186
|
+
The comments id
|
187
|
+
</p>
|
188
|
+
</dd>
|
189
|
+
<dt>comment_post_ID <em>alias: post.id</em></dt><dd><p>
|
190
|
+
The post id where the comment was posted
|
191
|
+
</p>
|
192
|
+
<pre>
|
193
|
+
Comment.find(1).post
|
194
|
+
</pre>
|
195
|
+
<p>
|
196
|
+
<em>The above returns the <a href="Post.html">Post</a> that the comment
|
197
|
+
belongs to</em>
|
198
|
+
</p>
|
199
|
+
</dd>
|
200
|
+
<dt>comment_author</dt><dd><p>
|
201
|
+
The name of the auther (could be stored in user.name, <a
|
202
|
+
href="User.html#method-i-name">User#name</a>)
|
203
|
+
</p>
|
204
|
+
</dd>
|
205
|
+
<dt>comment_author_email</dt><dd><p>
|
206
|
+
The email of the author (could be stored in user.email, <a
|
207
|
+
href="User.html#method-i-email">User#email</a>)
|
208
|
+
</p>
|
209
|
+
</dd>
|
210
|
+
<dt>comment_author_url</dt><dd><p>
|
211
|
+
The url of the author (could be stored in user.url, User#url)
|
212
|
+
</p>
|
213
|
+
</dd>
|
214
|
+
<dt>comment_author_IP</dt><dd><p>
|
215
|
+
The ip of the author
|
216
|
+
</p>
|
217
|
+
</dd>
|
218
|
+
<dt>comment_date</dt><dd><p>
|
219
|
+
The date the comment was posted
|
220
|
+
</p>
|
221
|
+
</dd>
|
222
|
+
<dt>comment_date_gmt</dt><dd><p>
|
223
|
+
The date the comment was posted in gmt/utc time
|
224
|
+
</p>
|
225
|
+
</dd>
|
226
|
+
<dt>comment_content <em>alias: <a href="Comment.html#method-i-content">Comment#content</a></em></dt><dd><p>
|
227
|
+
The content of the comment
|
228
|
+
</p>
|
229
|
+
</dd>
|
230
|
+
<dt>comment_karma</dt><dd><p>
|
231
|
+
The comment karma
|
232
|
+
</p>
|
233
|
+
</dd>
|
234
|
+
<dt>comment_approved</dt><dd><p>
|
235
|
+
If the comment has been approved or not
|
236
|
+
</p>
|
237
|
+
</dd>
|
238
|
+
<dt>comment_agent</dt><dd><p>
|
239
|
+
The agent of the comment
|
240
|
+
</p>
|
241
|
+
</dd>
|
242
|
+
<dt>comment_type</dt><dd><p>
|
243
|
+
The type of comment
|
244
|
+
</p>
|
245
|
+
</dd>
|
246
|
+
<dt>comment_parent</dt><dd><p>
|
247
|
+
The parent comment id if any
|
248
|
+
</p>
|
249
|
+
</dd>
|
250
|
+
<dt>user_id</dt><dd><p>
|
251
|
+
The user id of the author (0 if not registered user)
|
252
|
+
</p>
|
253
|
+
<pre>
|
254
|
+
Comment.find(1).user
|
255
|
+
</pre>
|
256
|
+
<p>
|
257
|
+
<em>The above returns the <a href="User.html">User</a> that posted the
|
258
|
+
comment if user_id isn’t 0</em>
|
259
|
+
</p>
|
260
|
+
</dd>
|
261
|
+
</dl>
|
262
|
+
|
263
|
+
</div>
|
264
|
+
|
265
|
+
<!-- Constants -->
|
266
|
+
|
267
|
+
|
268
|
+
<!-- Attributes -->
|
269
|
+
|
270
|
+
|
271
|
+
<!-- Methods -->
|
272
|
+
|
273
|
+
<div id="public-instance-method-details" class="method-section section">
|
274
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
275
|
+
|
276
|
+
|
277
|
+
<div id="content-method" class="method-detail ">
|
278
|
+
<a name="method-i-content"></a>
|
279
|
+
|
280
|
+
<div class="method-heading">
|
281
|
+
|
282
|
+
<span class="method-name">content</span><span
|
283
|
+
class="method-args">()</span>
|
284
|
+
<span class="method-click-advice">click to toggle source</span>
|
285
|
+
|
286
|
+
</div>
|
287
|
+
|
288
|
+
<div class="method-description">
|
289
|
+
|
290
|
+
<p>
|
291
|
+
Grab the content of the selected comment
|
292
|
+
</p>
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
<div class="method-source-code"
|
297
|
+
id="content-source">
|
298
|
+
<pre>
|
299
|
+
<span class="ruby-comment cmt"># File lib/wpb/comment.rb, line 56</span>
|
300
|
+
56: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content</span>
|
301
|
+
57: <span class="ruby-identifier">comment_content</span>
|
302
|
+
58: <span class="ruby-keyword kw">end</span></pre>
|
303
|
+
</div>
|
304
|
+
|
305
|
+
</div>
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
</div>
|
311
|
+
|
312
|
+
|
313
|
+
<div id="content--method" class="method-detail ">
|
314
|
+
<a name="method-i-content%3D"></a>
|
315
|
+
|
316
|
+
<div class="method-heading">
|
317
|
+
|
318
|
+
<span class="method-name">content=</span><span
|
319
|
+
class="method-args">(new_content)</span>
|
320
|
+
<span class="method-click-advice">click to toggle source</span>
|
321
|
+
|
322
|
+
</div>
|
323
|
+
|
324
|
+
<div class="method-description">
|
325
|
+
|
326
|
+
<p>
|
327
|
+
Set the content of the selected comment
|
328
|
+
</p>
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
<div class="method-source-code"
|
333
|
+
id="content--source">
|
334
|
+
<pre>
|
335
|
+
<span class="ruby-comment cmt"># File lib/wpb/comment.rb, line 63</span>
|
336
|
+
63: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content=</span> <span class="ruby-identifier">new_content</span>
|
337
|
+
64: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">comment_content</span> = <span class="ruby-identifier">new_content</span>
|
338
|
+
65: <span class="ruby-keyword kw">end</span></pre>
|
339
|
+
</div>
|
340
|
+
|
341
|
+
</div>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
</div>
|
347
|
+
|
348
|
+
|
349
|
+
</div>
|
350
|
+
|
351
|
+
<div id="private-instance-method-details" class="method-section section">
|
352
|
+
<h3 class="section-header">Private Instance Methods</h3>
|
353
|
+
|
354
|
+
|
355
|
+
<div id="set-default-values-method" class="method-detail ">
|
356
|
+
<a name="method-i-set_default_values"></a>
|
357
|
+
|
358
|
+
<div class="method-heading">
|
359
|
+
|
360
|
+
<span class="method-name">set_default_values</span><span
|
361
|
+
class="method-args">()</span>
|
362
|
+
<span class="method-click-advice">click to toggle source</span>
|
363
|
+
|
364
|
+
</div>
|
365
|
+
|
366
|
+
<div class="method-description">
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
<div class="method-source-code"
|
373
|
+
id="set-default-values-source">
|
374
|
+
<pre>
|
375
|
+
<span class="ruby-comment cmt"># File lib/wpb/comment.rb, line 68</span>
|
376
|
+
68: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_default_values</span>
|
377
|
+
69: <span class="ruby-identifier">t</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
|
378
|
+
70: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">comment_date</span> = <span class="ruby-identifier">t</span>
|
379
|
+
71: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">comment_date_gmt</span> = <span class="ruby-identifier">t</span>.<span class="ruby-identifier">gmtime</span>
|
380
|
+
72: <span class="ruby-keyword kw">end</span></pre>
|
381
|
+
</div>
|
382
|
+
|
383
|
+
</div>
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
</div>
|
389
|
+
|
390
|
+
|
391
|
+
</div>
|
392
|
+
|
393
|
+
|
394
|
+
</div>
|
395
|
+
|
396
|
+
|
397
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
398
|
+
|
399
|
+
<p>Disabled; run with --debug to generate this.</p>
|
400
|
+
|
401
|
+
</div>
|
402
|
+
|
403
|
+
<div id="validator-badges">
|
404
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
405
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
406
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
407
|
+
</div>
|
408
|
+
|
409
|
+
</body>
|
410
|
+
</html>
|
411
|
+
|