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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 638cbacbd4bc5b6f49a180bc22b742da1a6533cb
4
- data.tar.gz: 5e36bd4eb9356a917126a707ed5813aee09a6bbf
3
+ metadata.gz: 14e3aae2519ee21a9d03ea4d04b25d3089dcf520
4
+ data.tar.gz: 02b5ba61953a681a20a03d9d3e4cc26ef6917dc1
5
5
  SHA512:
6
- metadata.gz: 832a9df3c37fccccac55f0bd28fda4906df5172ac070437fab5258cd2dc56315215efafc483feca62814edc011a822ffb267019585e115184dfbd536a6335fcd
7
- data.tar.gz: b55edee932d4c53ef673ba95e0d2b3c83545f75a319edd51fa43e6df33dcb0057e3656bfe8da8b7b54abc4b83113953f29a3ba92aeb588464cfdc04219f5f31b
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.
@@ -0,0 +1,4 @@
1
+ absorb-gem
2
+ ==========
3
+
4
+ Extend a class by a module, limited to the scope of a block.
@@ -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">&gt;&gt;</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">&gt;&gt;</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">#=&gt; Works!</span>
149
+ <span class="ruby-operator">&gt;&gt;</span> <span class="ruby-keyword">end</span>
150
+ <span class="ruby-operator">&gt;&gt;</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">#=&gt; 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">&amp;</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">&amp;</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">&amp;</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
+
@@ -0,0 +1,2 @@
1
+ Mon, 28 Apr 2014 23:18:32 +0000
2
+ lib/absorb.rb Mon, 28 Apr 2014 23:10:38 +0000
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -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
+