tabletop 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/.gitignore +1 -0
  2. data/Rakefile +1 -1
  3. data/doc/Fixnum.html +313 -0
  4. data/doc/Tabletop/Coin.html +351 -0
  5. data/doc/Tabletop/Die.html +480 -0
  6. data/doc/Tabletop/FudgeDie.html +315 -0
  7. data/doc/Tabletop/NotEnoughTokensError.html +146 -0
  8. data/doc/Tabletop/Pool.html +770 -0
  9. data/doc/Tabletop/Possibility.html +235 -0
  10. data/doc/Tabletop/Roll.html +731 -0
  11. data/doc/Tabletop/TokenStack.html +394 -0
  12. data/doc/Tabletop.html +185 -0
  13. data/doc/created.rid +8 -0
  14. data/doc/images/brick.png +0 -0
  15. data/doc/images/brick_link.png +0 -0
  16. data/doc/images/bug.png +0 -0
  17. data/doc/images/bullet_black.png +0 -0
  18. data/doc/images/bullet_toggle_minus.png +0 -0
  19. data/doc/images/bullet_toggle_plus.png +0 -0
  20. data/doc/images/date.png +0 -0
  21. data/doc/images/find.png +0 -0
  22. data/doc/images/loadingAnimation.gif +0 -0
  23. data/doc/images/macFFBgHack.png +0 -0
  24. data/doc/images/package.png +0 -0
  25. data/doc/images/page_green.png +0 -0
  26. data/doc/images/page_white_text.png +0 -0
  27. data/doc/images/page_white_width.png +0 -0
  28. data/doc/images/plugin.png +0 -0
  29. data/doc/images/ruby.png +0 -0
  30. data/doc/images/tag_green.png +0 -0
  31. data/doc/images/wrench.png +0 -0
  32. data/doc/images/wrench_orange.png +0 -0
  33. data/doc/images/zoom.png +0 -0
  34. data/doc/index.html +167 -0
  35. data/doc/js/darkfish.js +116 -0
  36. data/doc/js/jquery.js +32 -0
  37. data/doc/js/quicksearch.js +114 -0
  38. data/doc/js/thickbox-compressed.js +10 -0
  39. data/doc/lib/fixnum_rb.html +54 -0
  40. data/doc/lib/tabletop/pool_rb.html +54 -0
  41. data/doc/lib/tabletop/randomizers_rb.html +52 -0
  42. data/doc/lib/tabletop/roll_rb.html +52 -0
  43. data/doc/lib/tabletop/token_rb.html +52 -0
  44. data/doc/lib/tabletop/version_rb.html +52 -0
  45. data/doc/lib/tabletop_rb.html +52 -0
  46. data/doc/rdoc.css +763 -0
  47. data/lib/fixnum.rb +8 -0
  48. data/lib/tabletop/pool.rb +32 -1
  49. data/lib/tabletop/randomizers.rb +22 -1
  50. data/lib/tabletop/roll.rb +65 -10
  51. data/lib/tabletop/token.rb +7 -4
  52. data/lib/tabletop/version.rb +1 -1
  53. data/spec/randomizers_spec.rb +6 -1
  54. data/spec/spec_helper.rb +1 -1
  55. data/tabletop.gemspec +1 -0
  56. metadata +60 -5
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  Gemfile.lock
2
2
  .DS_Store
3
3
  pkg/
4
+ doc/
4
5
  *.gem
data/Rakefile CHANGED
@@ -58,5 +58,5 @@ end
58
58
  desc "Push changes to github and rubygems"
59
59
  task :publish do
60
60
  system "git push origin master --tags"
61
- system "gem push pkg/#{gemspec.name}-#{gemspec.version}"
61
+ system "gem push pkg/#{gemspec.name}-#{gemspec.version}.gem"
62
62
  end
data/doc/Fixnum.html ADDED
@@ -0,0 +1,313 @@
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: Fixnum</title>
9
+
10
+ <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
15
+ <script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
16
+
17
+ </head>
18
+ <body id="top" class="class">
19
+
20
+ <div id="metadata">
21
+ <div id="home-metadata">
22
+ <div id="home-section" class="section">
23
+ <h3 class="section-header">
24
+ <a href="./index.html">Home</a>
25
+ <a href="./index.html#classes">Classes</a>
26
+ <a href="./index.html#methods">Methods</a>
27
+ </h3>
28
+ </div>
29
+ </div>
30
+
31
+ <div id="file-metadata">
32
+ <div id="file-list-section" class="section">
33
+ <h3 class="section-header">In Files</h3>
34
+ <div class="section-body">
35
+ <ul>
36
+
37
+ <li><a href="./lib/fixnum_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
+ class="thickbox" title="lib/fixnum.rb">lib/fixnum.rb</a></li>
39
+
40
+ </ul>
41
+ </div>
42
+ </div>
43
+
44
+
45
+ </div>
46
+
47
+ <div id="class-metadata">
48
+
49
+ <!-- Parent Class -->
50
+ <div id="parent-class-section" class="section">
51
+ <h3 class="section-header">Parent</h3>
52
+
53
+ <p class="link">Object</p>
54
+
55
+ </div>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ <!-- Method Quickref -->
64
+ <div id="method-list-section" class="section">
65
+ <h3 class="section-header">Methods</h3>
66
+ <ul class="link-list">
67
+
68
+ <li><a href="#method-i-dF">#dF</a></li>
69
+
70
+ <li><a href="#method-i-dX">#dX</a></li>
71
+
72
+ <li><a href="#method-i-method_missing">#method_missing</a></li>
73
+
74
+ <li><a href="#method-i-respond_to-3F">#respond_to?</a></li>
75
+
76
+ </ul>
77
+ </div>
78
+
79
+
80
+
81
+ </div>
82
+
83
+ <div id="project-metadata">
84
+
85
+
86
+
87
+ <div id="classindex-section" class="section project-section">
88
+ <h3 class="section-header">Class/Module Index
89
+ <span class="search-toggle"><img src="./images/find.png"
90
+ height="16" width="16" alt="[+]"
91
+ title="show/hide quicksearch" /></span></h3>
92
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
93
+ <fieldset>
94
+ <legend>Quicksearch</legend>
95
+ <input type="text" name="quicksearch" value=""
96
+ class="quicksearch-field" />
97
+ </fieldset>
98
+ </form>
99
+
100
+ <ul class="link-list">
101
+
102
+ <li><a href="./Tabletop.html">Tabletop</a></li>
103
+
104
+ <li><a href="./Tabletop/Coin.html">Tabletop::Coin</a></li>
105
+
106
+ <li><a href="./Tabletop/Die.html">Tabletop::Die</a></li>
107
+
108
+ <li><a href="./Tabletop/FudgeDie.html">Tabletop::FudgeDie</a></li>
109
+
110
+ <li><a href="./Tabletop/NotEnoughTokensError.html">Tabletop::NotEnoughTokensError</a></li>
111
+
112
+ <li><a href="./Tabletop/Pool.html">Tabletop::Pool</a></li>
113
+
114
+ <li><a href="./Tabletop/Roll.html">Tabletop::Roll</a></li>
115
+
116
+ <li><a href="./Tabletop/TokenStack.html">Tabletop::TokenStack</a></li>
117
+
118
+ <li><a href="./Fixnum.html">Fixnum</a></li>
119
+
120
+ </ul>
121
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
122
+ </div>
123
+
124
+
125
+ </div>
126
+ </div>
127
+
128
+ <div id="documentation">
129
+ <h1 class="class">Fixnum</h1>
130
+
131
+ <div id="description" class="description">
132
+
133
+ </div><!-- description -->
134
+
135
+
136
+
137
+
138
+ <div id="5Buntitled-5D" class="documentation-section">
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+ <!-- Methods -->
148
+
149
+ <div id="public-instance-method-details" class="method-section section">
150
+ <h3 class="section-header">Public Instance Methods</h3>
151
+
152
+
153
+ <div id="dF-method" class="method-detail ">
154
+ <a name="method-i-dF"></a>
155
+
156
+
157
+ <div class="method-heading">
158
+ <span class="method-name">dF</span><span
159
+ class="method-args">()</span>
160
+ <span class="method-click-advice">click to toggle source</span>
161
+ </div>
162
+
163
+
164
+ <div class="method-description">
165
+
166
+ <p>Returns a pool of fudge dice of size self</p>
167
+
168
+
169
+
170
+ <div class="method-source-code" id="dF-source">
171
+ <pre>
172
+ <span class="ruby-comment"># File lib/fixnum.rb, line 13</span>
173
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">dF</span>
174
+ <span class="ruby-identifier">dice</span> = []
175
+ <span class="ruby-identifier">times</span> {<span class="ruby-identifier">dice</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Tabletop</span><span class="ruby-operator">::</span><span class="ruby-constant">FudgeDie</span>.<span class="ruby-identifier">new</span>}
176
+ <span class="ruby-constant">Tabletop</span><span class="ruby-operator">::</span><span class="ruby-constant">Pool</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">dice</span>)
177
+ <span class="ruby-keyword">end</span></pre>
178
+ </div><!-- dF-source -->
179
+
180
+ </div>
181
+
182
+
183
+
184
+
185
+ </div><!-- dF-method -->
186
+
187
+
188
+ <div id="dX-method" class="method-detail ">
189
+ <a name="method-i-dX"></a>
190
+
191
+
192
+ <div class="method-heading">
193
+ <span class="method-name">dX</span><span
194
+ class="method-args">(sides)</span>
195
+ <span class="method-click-advice">click to toggle source</span>
196
+ </div>
197
+
198
+
199
+ <div class="method-description">
200
+
201
+ <p>Returns a pool of dice of the given sides and size self</p>
202
+
203
+
204
+
205
+ <div class="method-source-code" id="dX-source">
206
+ <pre>
207
+ <span class="ruby-comment"># File lib/fixnum.rb, line 6</span>
208
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">dX</span>(<span class="ruby-identifier">sides</span>)
209
+ <span class="ruby-identifier">dice</span> = []
210
+ <span class="ruby-identifier">times</span> { <span class="ruby-identifier">dice</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Tabletop</span><span class="ruby-operator">::</span><span class="ruby-constant">Die</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sides</span>) }
211
+ <span class="ruby-constant">Tabletop</span><span class="ruby-operator">::</span><span class="ruby-constant">Pool</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">dice</span>)
212
+ <span class="ruby-keyword">end</span></pre>
213
+ </div><!-- dX-source -->
214
+
215
+ </div>
216
+
217
+
218
+
219
+
220
+ </div><!-- dX-method -->
221
+
222
+
223
+ <div id="method_missing-method" class="method-detail ">
224
+ <a name="method-i-method_missing"></a>
225
+
226
+
227
+ <div class="method-heading">
228
+ <span class="method-name">method_missing</span><span
229
+ class="method-args">(symbol, *args, &block)</span>
230
+ <span class="method-click-advice">click to toggle source</span>
231
+ </div>
232
+
233
+
234
+ <div class="method-description">
235
+
236
+ <p>Matches any methods of the form d(.*), and calls <a
237
+ href="Fixnum.html#method-i-dX">dX</a>($1.to_i)</p>
238
+
239
+
240
+
241
+ <div class="method-source-code" id="method_missing-source">
242
+ <pre>
243
+ <span class="ruby-comment"># File lib/fixnum.rb, line 20</span>
244
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">symbol</span>, *<span class="ruby-identifier">args</span>, &amp;<span class="ruby-identifier">block</span>)
245
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">symbol</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^d(.*)$/</span>
246
+ <span class="ruby-identifier">dX</span>(<span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span>)
247
+ <span class="ruby-keyword">else</span>
248
+ <span class="ruby-keyword">super</span>
249
+ <span class="ruby-keyword">end</span>
250
+ <span class="ruby-keyword">end</span></pre>
251
+ </div><!-- method_missing-source -->
252
+
253
+ </div>
254
+
255
+
256
+
257
+
258
+ </div><!-- method_missing-method -->
259
+
260
+
261
+ <div id="respond_to-3F-method" class="method-detail ">
262
+ <a name="method-i-respond_to-3F"></a>
263
+
264
+
265
+ <div class="method-heading">
266
+ <span class="method-name">respond_to?</span><span
267
+ class="method-args">(symbol, include_private = false)</span>
268
+ <span class="method-click-advice">click to toggle source</span>
269
+ </div>
270
+
271
+
272
+ <div class="method-description">
273
+
274
+ <p>Returns true for :dN, where N.to_i is a number &gt; 0</p>
275
+
276
+
277
+
278
+ <div class="method-source-code" id="respond_to-3F-source">
279
+ <pre>
280
+ <span class="ruby-comment"># File lib/fixnum.rb, line 29</span>
281
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">symbol</span>, <span class="ruby-identifier">include_private</span> = <span class="ruby-keyword">false</span>)
282
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">symbol</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^d(.*)$/</span>
283
+ <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
284
+ <span class="ruby-keyword">else</span>
285
+ <span class="ruby-keyword">super</span>
286
+ <span class="ruby-keyword">end</span>
287
+ <span class="ruby-keyword">end</span></pre>
288
+ </div><!-- respond_to-3F-source -->
289
+
290
+ </div>
291
+
292
+
293
+
294
+
295
+ </div><!-- respond_to-3F-method -->
296
+
297
+
298
+ </div><!-- public-instance-method-details -->
299
+
300
+ </div><!-- 5Buntitled-5D -->
301
+
302
+
303
+ </div><!-- documentation -->
304
+
305
+ <div id="validator-badges">
306
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
307
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
308
+ Rdoc Generator</a> 2</small>.</p>
309
+ </div>
310
+
311
+ </body>
312
+ </html>
313
+
@@ -0,0 +1,351 @@
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: Tabletop::Coin</title>
9
+
10
+ <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
15
+ <script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
16
+
17
+ </head>
18
+ <body id="top" class="class">
19
+
20
+ <div id="metadata">
21
+ <div id="home-metadata">
22
+ <div id="home-section" class="section">
23
+ <h3 class="section-header">
24
+ <a href="../index.html">Home</a>
25
+ <a href="../index.html#classes">Classes</a>
26
+ <a href="../index.html#methods">Methods</a>
27
+ </h3>
28
+ </div>
29
+ </div>
30
+
31
+ <div id="file-metadata">
32
+ <div id="file-list-section" class="section">
33
+ <h3 class="section-header">In Files</h3>
34
+ <div class="section-body">
35
+ <ul>
36
+
37
+ <li><a href="../lib/tabletop/randomizers_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
+ class="thickbox" title="lib/tabletop/randomizers.rb">lib/tabletop/randomizers.rb</a></li>
39
+
40
+ </ul>
41
+ </div>
42
+ </div>
43
+
44
+
45
+ </div>
46
+
47
+ <div id="class-metadata">
48
+
49
+ <!-- Parent Class -->
50
+ <div id="parent-class-section" class="section">
51
+ <h3 class="section-header">Parent</h3>
52
+
53
+ <p class="link"><a href="Die.html">Tabletop::Die</a></p>
54
+
55
+ </div>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ <!-- Method Quickref -->
64
+ <div id="method-list-section" class="section">
65
+ <h3 class="section-header">Methods</h3>
66
+ <ul class="link-list">
67
+
68
+ <li><a href="#method-c-new">::new</a></li>
69
+
70
+ <li><a href="#method-i-flip">#flip</a></li>
71
+
72
+ <li><a href="#method-i-roll">#roll</a></li>
73
+
74
+ <li><a href="#method-i-to_s">#to_s</a></li>
75
+
76
+ <li><a href="#method-i-valid_value-3F">#valid_value?</a></li>
77
+
78
+ </ul>
79
+ </div>
80
+
81
+
82
+
83
+ </div>
84
+
85
+ <div id="project-metadata">
86
+
87
+
88
+
89
+ <div id="classindex-section" class="section project-section">
90
+ <h3 class="section-header">Class/Module Index
91
+ <span class="search-toggle"><img src="../images/find.png"
92
+ height="16" width="16" alt="[+]"
93
+ title="show/hide quicksearch" /></span></h3>
94
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
95
+ <fieldset>
96
+ <legend>Quicksearch</legend>
97
+ <input type="text" name="quicksearch" value=""
98
+ class="quicksearch-field" />
99
+ </fieldset>
100
+ </form>
101
+
102
+ <ul class="link-list">
103
+
104
+ <li><a href="../Tabletop.html">Tabletop</a></li>
105
+
106
+ <li><a href="../Tabletop/Coin.html">Tabletop::Coin</a></li>
107
+
108
+ <li><a href="../Tabletop/Die.html">Tabletop::Die</a></li>
109
+
110
+ <li><a href="../Tabletop/FudgeDie.html">Tabletop::FudgeDie</a></li>
111
+
112
+ <li><a href="../Tabletop/NotEnoughTokensError.html">Tabletop::NotEnoughTokensError</a></li>
113
+
114
+ <li><a href="../Tabletop/Pool.html">Tabletop::Pool</a></li>
115
+
116
+ <li><a href="../Tabletop/Roll.html">Tabletop::Roll</a></li>
117
+
118
+ <li><a href="../Tabletop/TokenStack.html">Tabletop::TokenStack</a></li>
119
+
120
+ <li><a href="../Fixnum.html">Fixnum</a></li>
121
+
122
+ </ul>
123
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
124
+ </div>
125
+
126
+
127
+ </div>
128
+ </div>
129
+
130
+ <div id="documentation">
131
+ <h1 class="class">Tabletop::Coin</h1>
132
+
133
+ <div id="description" class="description">
134
+
135
+ <p>A coin is a kind of two-sided <a href="Die.html">Die</a> that has a value
136
+ of either 0 or 1</p>
137
+
138
+ </div><!-- description -->
139
+
140
+
141
+
142
+
143
+ <div id="5Buntitled-5D" class="documentation-section">
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+ <!-- Methods -->
153
+
154
+ <div id="public-class-method-details" class="method-section section">
155
+ <h3 class="section-header">Public Class Methods</h3>
156
+
157
+
158
+ <div id="new-method" class="method-detail ">
159
+ <a name="method-c-new"></a>
160
+
161
+
162
+ <div class="method-heading">
163
+ <span class="method-name">new</span><span
164
+ class="method-args">(value=nil)</span>
165
+ <span class="method-click-advice">click to toggle source</span>
166
+ </div>
167
+
168
+
169
+ <div class="method-description">
170
+
171
+
172
+
173
+
174
+
175
+ <div class="method-source-code" id="new-source">
176
+ <pre>
177
+ <span class="ruby-comment"># File lib/tabletop/randomizers.rb, line 83</span>
178
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">value</span>=<span class="ruby-keyword">nil</span>)
179
+ <span class="ruby-keyword">super</span>(<span class="ruby-value">2</span>, <span class="ruby-identifier">value</span>)
180
+ <span class="ruby-keyword">end</span></pre>
181
+ </div><!-- new-source -->
182
+
183
+ </div>
184
+
185
+
186
+
187
+
188
+ </div><!-- new-method -->
189
+
190
+
191
+ </div><!-- public-class-method-details -->
192
+
193
+ <div id="public-instance-method-details" class="method-section section">
194
+ <h3 class="section-header">Public Instance Methods</h3>
195
+
196
+
197
+ <div id="flip-method" class="method-detail ">
198
+ <a name="method-i-flip"></a>
199
+
200
+
201
+ <div class="method-heading">
202
+ <span class="method-name">flip</span><span
203
+ class="method-args">()</span>
204
+ <span class="method-click-advice">click to toggle source</span>
205
+ </div>
206
+
207
+
208
+ <div class="method-description">
209
+
210
+ <p><a href="Roll.html">Roll</a>, then return itself</p>
211
+
212
+
213
+
214
+ <div class="method-source-code" id="flip-source">
215
+ <pre>
216
+ <span class="ruby-comment"># File lib/tabletop/randomizers.rb, line 92</span>
217
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">flip</span>
218
+ <span class="ruby-identifier">roll</span>
219
+ <span class="ruby-keyword">self</span>
220
+ <span class="ruby-keyword">end</span></pre>
221
+ </div><!-- flip-source -->
222
+
223
+ </div>
224
+
225
+
226
+
227
+
228
+ </div><!-- flip-method -->
229
+
230
+
231
+ <div id="roll-method" class="method-detail ">
232
+ <a name="method-i-roll"></a>
233
+
234
+
235
+ <div class="method-heading">
236
+ <span class="method-name">roll</span><span
237
+ class="method-args">(:nodoc: @value = rand(sides))</span>
238
+ <span class="method-click-advice">click to toggle source</span>
239
+ </div>
240
+
241
+
242
+ <div class="method-description">
243
+
244
+
245
+
246
+
247
+
248
+ <div class="method-source-code" id="roll-source">
249
+ <pre>
250
+ <span class="ruby-comment"># File lib/tabletop/randomizers.rb, line 87</span>
251
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">roll</span> <span class="ruby-operator">:</span><span class="ruby-identifier">nodoc</span><span class="ruby-operator">:</span>
252
+ <span class="ruby-ivar">@value</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">sides</span>)
253
+ <span class="ruby-keyword">end</span></pre>
254
+ </div><!-- roll-source -->
255
+
256
+ </div>
257
+
258
+
259
+
260
+
261
+ </div><!-- roll-method -->
262
+
263
+
264
+ <div id="to_s-method" class="method-detail ">
265
+ <a name="method-i-to_s"></a>
266
+
267
+
268
+ <div class="method-heading">
269
+ <span class="method-name">to_s</span><span
270
+ class="method-args">()</span>
271
+ <span class="method-click-advice">click to toggle source</span>
272
+ </div>
273
+
274
+
275
+ <div class="method-description">
276
+
277
+ <p>Returns either “( )” or “(+)” depending on @value</p>
278
+
279
+
280
+
281
+ <div class="method-source-code" id="to_s-source">
282
+ <pre>
283
+ <span class="ruby-comment"># File lib/tabletop/randomizers.rb, line 98</span>
284
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
285
+ <span class="ruby-node">&quot;(#{[' ', '+'][value]})&quot;</span>
286
+ <span class="ruby-keyword">end</span></pre>
287
+ </div><!-- to_s-source -->
288
+
289
+ </div>
290
+
291
+
292
+
293
+
294
+ </div><!-- to_s-method -->
295
+
296
+
297
+ </div><!-- public-instance-method-details -->
298
+
299
+ <div id="protected-instance-method-details" class="method-section section">
300
+ <h3 class="section-header">Protected Instance Methods</h3>
301
+
302
+
303
+ <div id="valid_value-3F-method" class="method-detail ">
304
+ <a name="method-i-valid_value-3F"></a>
305
+
306
+
307
+ <div class="method-heading">
308
+ <span class="method-name">valid_value?</span><span
309
+ class="method-args">(val)</span>
310
+ <span class="method-click-advice">click to toggle source</span>
311
+ </div>
312
+
313
+
314
+ <div class="method-description">
315
+
316
+
317
+
318
+
319
+
320
+ <div class="method-source-code" id="valid_value-3F-source">
321
+ <pre>
322
+ <span class="ruby-comment"># File lib/tabletop/randomizers.rb, line 103</span>
323
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">valid_value?</span>(<span class="ruby-identifier">val</span>)
324
+ [<span class="ruby-value">0</span>,<span class="ruby-value">1</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">val</span>)
325
+ <span class="ruby-keyword">end</span></pre>
326
+ </div><!-- valid_value-3F-source -->
327
+
328
+ </div>
329
+
330
+
331
+
332
+
333
+ </div><!-- valid_value-3F-method -->
334
+
335
+
336
+ </div><!-- protected-instance-method-details -->
337
+
338
+ </div><!-- 5Buntitled-5D -->
339
+
340
+
341
+ </div><!-- documentation -->
342
+
343
+ <div id="validator-badges">
344
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
345
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
346
+ Rdoc Generator</a> 2</small>.</p>
347
+ </div>
348
+
349
+ </body>
350
+ </html>
351
+