absorb 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/README.md +4 -0
- data/doc/Object.html +289 -0
- data/doc/created.rid +2 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +71 -0
- data/doc/js/darkfish.js +155 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +595 -0
- data/doc/table_of_contents.html +52 -0
- data/test/test_absorb.rb +4 -4
- metadata +39 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14e3aae2519ee21a9d03ea4d04b25d3089dcf520
|
4
|
+
data.tar.gz: 02b5ba61953a681a20a03d9d3e4cc26ef6917dc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 713fb330b78a070cfea2626a41e01943754519d66b053dcff254744f077529e0e79357d4c7e5a8b2b48ca529c5eefa4913f5163f76c1a4b4b1e09328e85ef06c
|
7
|
+
data.tar.gz: 982eccdd9c4af72dbb054a79045a57ae07ca648eada5119c4249bfae9ccf12beb1ecac2ca66bd53bbb72344953a93f5bbf20fe5e75a8f3e33a53c624ec42af0f
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Miroslav
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
data/doc/Object.html
ADDED
@@ -0,0 +1,289 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class Object - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
<div id="file-metadata">
|
49
|
+
<nav id="file-list-section" class="section">
|
50
|
+
<h3 class="section-header">Defined In</h3>
|
51
|
+
<ul>
|
52
|
+
<li>lib/absorb.rb
|
53
|
+
</ul>
|
54
|
+
</nav>
|
55
|
+
|
56
|
+
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div id="class-metadata">
|
60
|
+
|
61
|
+
<nav id="parent-class-section" class="section">
|
62
|
+
<h3 class="section-header">Parent</h3>
|
63
|
+
|
64
|
+
<p class="link">BasicObject
|
65
|
+
|
66
|
+
</nav>
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<nav id="method-list-section" class="section">
|
72
|
+
<h3 class="section-header">Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list">
|
75
|
+
|
76
|
+
<li ><a href="#method-i-absorb">#absorb</a>
|
77
|
+
|
78
|
+
<li class="calls-super" ><a href="#method-i-method_missing">#method_missing</a>
|
79
|
+
|
80
|
+
<li class="calls-super" ><a href="#method-i-respond_to-3F">#respond_to?</a>
|
81
|
+
|
82
|
+
</ul>
|
83
|
+
</nav>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="project-metadata">
|
88
|
+
|
89
|
+
<nav id="classindex-section" class="section project-section">
|
90
|
+
<h3 class="section-header">Class and Module Index</h3>
|
91
|
+
|
92
|
+
<ul class="link-list">
|
93
|
+
|
94
|
+
<li><a href="./Object.html">Object</a>
|
95
|
+
|
96
|
+
</ul>
|
97
|
+
</nav>
|
98
|
+
|
99
|
+
</div>
|
100
|
+
</nav>
|
101
|
+
|
102
|
+
<div id="documentation">
|
103
|
+
<h1 class="class">class Object</h1>
|
104
|
+
|
105
|
+
<div id="description" class="description">
|
106
|
+
|
107
|
+
<p>Pickup – The <a href="Object.html">Object</a> extension that gives us
|
108
|
+
pickups</p>
|
109
|
+
|
110
|
+
</div><!-- description -->
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<!-- Methods -->
|
125
|
+
|
126
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
127
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
128
|
+
|
129
|
+
|
130
|
+
<div id="method-i-absorb" class="method-detail ">
|
131
|
+
|
132
|
+
<div class="method-heading">
|
133
|
+
<span class="method-name">absorb</span><span
|
134
|
+
class="method-args">(name, &block)</span>
|
135
|
+
|
136
|
+
<span class="method-click-advice">click to toggle source</span>
|
137
|
+
|
138
|
+
</div>
|
139
|
+
|
140
|
+
|
141
|
+
<div class="method-description">
|
142
|
+
|
143
|
+
<p>Absorb lets you locally extend a class with a module</p>
|
144
|
+
|
145
|
+
<p>Example:</p>
|
146
|
+
|
147
|
+
<pre class="ruby"><span class="ruby-operator">>></span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">absorb</span>(<span class="ruby-constant">MyArrayExtension</span>) <span class="ruby-keyword">do</span>
|
148
|
+
<span class="ruby-operator">>></span> [<span class="ruby-value">1</span>,<span class="ruby-value">2</span>,<span class="ruby-value">3</span>].<span class="ruby-identifier">nowHasThisMethodFromModule</span> <span class="ruby-comment">#=> Works!</span>
|
149
|
+
<span class="ruby-operator">>></span> <span class="ruby-keyword">end</span>
|
150
|
+
<span class="ruby-operator">>></span> [<span class="ruby-value">1</span>,<span class="ruby-value">2</span>,<span class="ruby-value">3</span>].<span class="ruby-identifier">nowHasThisMethodFromModule</span> <span class="ruby-comment">#=> NoMethodError</span>
|
151
|
+
</pre>
|
152
|
+
|
153
|
+
<p>Arguments:</p>
|
154
|
+
|
155
|
+
<pre>module_name: (String)
|
156
|
+
block: (Block)</pre>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<div class="method-source-code" id="absorb-source">
|
162
|
+
<pre><span class="ruby-comment"># File lib/absorb.rb, line 47</span>
|
163
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">absorb</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
164
|
+
<span class="ruby-identifier">@@local_extensions</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">name</span>)
|
165
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>
|
166
|
+
<span class="ruby-identifier">@@local_extensions</span>.<span class="ruby-identifier">pop</span>
|
167
|
+
<span class="ruby-identifier">result</span>
|
168
|
+
<span class="ruby-keyword">end</span></pre>
|
169
|
+
</div><!-- absorb-source -->
|
170
|
+
|
171
|
+
</div>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
</div><!-- absorb-method -->
|
177
|
+
|
178
|
+
|
179
|
+
<div id="method-i-method_missing" class="method-detail ">
|
180
|
+
|
181
|
+
<div class="method-heading">
|
182
|
+
<span class="method-name">method_missing</span><span
|
183
|
+
class="method-args">(name, *args, &block)</span>
|
184
|
+
|
185
|
+
<span class="method-click-advice">click to toggle source</span>
|
186
|
+
|
187
|
+
</div>
|
188
|
+
|
189
|
+
|
190
|
+
<div class="method-description">
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<div class="method-calls-super">
|
196
|
+
Calls superclass method
|
197
|
+
|
198
|
+
</div>
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<div class="method-source-code" id="method_missing-source">
|
203
|
+
<pre><span class="ruby-comment"># File lib/absorb.rb, line 5</span>
|
204
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
205
|
+
<span class="ruby-identifier">klass</span> = <span class="ruby-keyword">self</span>
|
206
|
+
<span class="ruby-identifier">@@local_extensions</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span>
|
207
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">name</span>
|
208
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">mod</span>
|
209
|
+
.<span class="ruby-identifier">instance_method</span>(<span class="ruby-identifier">name</span>)
|
210
|
+
.<span class="ruby-identifier">bind</span>(<span class="ruby-identifier">klass</span>)
|
211
|
+
.<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
212
|
+
<span class="ruby-keyword">end</span>
|
213
|
+
}
|
214
|
+
|
215
|
+
<span class="ruby-keyword">super</span>
|
216
|
+
<span class="ruby-keyword">end</span></pre>
|
217
|
+
</div><!-- method_missing-source -->
|
218
|
+
|
219
|
+
</div>
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
</div><!-- method_missing-method -->
|
225
|
+
|
226
|
+
|
227
|
+
<div id="method-i-respond_to-3F" class="method-detail ">
|
228
|
+
|
229
|
+
<div class="method-heading">
|
230
|
+
<span class="method-name">respond_to?</span><span
|
231
|
+
class="method-args">(method_name, include_all=false)</span>
|
232
|
+
|
233
|
+
<span class="method-click-advice">click to toggle source</span>
|
234
|
+
|
235
|
+
</div>
|
236
|
+
|
237
|
+
|
238
|
+
<div class="method-description">
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
<div class="method-calls-super">
|
244
|
+
Calls superclass method
|
245
|
+
|
246
|
+
</div>
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
<div class="method-source-code" id="respond_to-3F-source">
|
251
|
+
<pre><span class="ruby-comment"># File lib/absorb.rb, line 19</span>
|
252
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">include_all</span>=<span class="ruby-keyword">false</span>)
|
253
|
+
<span class="ruby-identifier">klass</span> = <span class="ruby-keyword">self</span>
|
254
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-keyword">super</span> <span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">include_all</span>
|
255
|
+
|
256
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span> <span class="ruby-keyword">then</span> <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span> <span class="ruby-keyword">end</span>
|
257
|
+
|
258
|
+
<span class="ruby-identifier">@@local_extensions</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span>
|
259
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">method_name</span>
|
260
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-keyword">true</span>
|
261
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
|
262
|
+
<span class="ruby-keyword">end</span>
|
263
|
+
}
|
264
|
+
|
265
|
+
<span class="ruby-identifier">result</span>
|
266
|
+
<span class="ruby-keyword">end</span></pre>
|
267
|
+
</div><!-- respond_to-3F-source -->
|
268
|
+
|
269
|
+
</div>
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
</div><!-- respond_to-3F-method -->
|
275
|
+
|
276
|
+
|
277
|
+
</section><!-- public-instance-method-details -->
|
278
|
+
|
279
|
+
</section><!-- 5Buntitled-5D -->
|
280
|
+
|
281
|
+
</div><!-- documentation -->
|
282
|
+
|
283
|
+
|
284
|
+
<footer id="validator-badges">
|
285
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
286
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
287
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
288
|
+
</footer>
|
289
|
+
|
data/doc/created.rid
ADDED
data/doc/images/add.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/doc/images/bug.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/doc/images/date.png
ADDED
Binary file
|
Binary file
|
data/doc/images/find.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/doc/images/ruby.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/doc/images/zoom.png
ADDED
Binary file
|
data/doc/index.html
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body>
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="project-metadata">
|
47
|
+
|
48
|
+
<nav id="classindex-section" class="section project-section">
|
49
|
+
<h3 class="section-header">Class and Module Index</h3>
|
50
|
+
|
51
|
+
<ul class="link-list">
|
52
|
+
|
53
|
+
<li><a href="./Object.html">Object</a>
|
54
|
+
|
55
|
+
</ul>
|
56
|
+
</nav>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
</nav>
|
60
|
+
|
61
|
+
<div id="documentation" class="description">
|
62
|
+
<p>This is the API documentation for RDoc Documentation.
|
63
|
+
</div>
|
64
|
+
|
65
|
+
|
66
|
+
<footer id="validator-badges">
|
67
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
68
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
69
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
70
|
+
</footer>
|
71
|
+
|