fuby 0.0.2 → 0.0.3

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.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/VERSION +1 -1
  4. data/fuby.gemspec +1 -1
  5. data/lib/fuby/alias_method.rb +26 -2
  6. data/lib/fuby/alias_singleton_method.rb +20 -0
  7. data/lib/fuby/ancestors.rb +12 -0
  8. data/lib/fuby/cardinality.rb +27 -0
  9. data/lib/fuby/curry_eval.rb +19 -0
  10. data/lib/fuby/deep_const_get.rb +13 -0
  11. data/lib/fuby/deep_each.rb +21 -6
  12. data/lib/fuby/define.rb +1 -0
  13. data/lib/fuby/define_missing_method.rb +13 -23
  14. data/lib/fuby/define_tok.rb +2 -0
  15. data/lib/fuby/descendants.rb +3 -4
  16. data/lib/fuby/eastern_name.rb +11 -0
  17. data/lib/fuby/enumerables.rb +7 -0
  18. data/lib/fuby/eql_componentwise.rb +7 -4
  19. data/lib/fuby/equivalence.rb +7 -4
  20. data/lib/fuby/eval.rb +1 -51
  21. data/lib/fuby/extend.rb +15 -4
  22. data/lib/fuby/first.rb +9 -0
  23. data/lib/fuby/hash_eval.rb +32 -0
  24. data/lib/fuby/include.rb +14 -3
  25. data/lib/fuby/invert.rb +10 -7
  26. data/lib/fuby/last.rb +9 -0
  27. data/lib/fuby/longest_common.rb +1 -15
  28. data/lib/fuby/longest_common_prefix.rb +11 -0
  29. data/lib/fuby/longest_common_suffix.rb +11 -0
  30. data/lib/fuby/matches.rb +12 -4
  31. data/lib/fuby/matches_componentwise.rb +11 -4
  32. data/lib/fuby/matches_part_of.rb +9 -5
  33. data/lib/fuby/matches_prefix_of.rb +6 -1
  34. data/lib/fuby/matches_suffix_of.rb +3 -0
  35. data/lib/fuby/method_added_as_binary_operator.rb +3 -1
  36. data/lib/fuby/method_added_as_filter.rb +1 -1
  37. data/lib/fuby/names.rb +9 -0
  38. data/lib/fuby/outer_module.rb +18 -0
  39. data/lib/fuby/part_of.rb +4 -0
  40. data/lib/fuby/pop.rb +3 -2
  41. data/lib/fuby/prefix_of.rb +5 -4
  42. data/lib/fuby/prepend.rb +12 -3
  43. data/lib/fuby/reject.rb +19 -0
  44. data/lib/fuby/select.rb +19 -0
  45. data/lib/fuby/self_and_descendants.rb +1 -3
  46. data/lib/fuby/send.rb +24 -0
  47. data/lib/fuby/shift.rb +3 -2
  48. data/lib/fuby/singleton_method_defined.rb +9 -0
  49. data/lib/fuby/subclass.rb +2 -2
  50. data/lib/fuby/submodule.rb +2 -2
  51. data/lib/fuby/suffix_of.rb +2 -6
  52. data/lib/fuby/take_until.rb +5 -0
  53. data/lib/fuby/take_while.rb +8 -0
  54. data/lib/fuby/to_camel_case.rb +1 -1
  55. data/lib/fuby/to_dot_case.rb +26 -0
  56. data/lib/fuby/to_hash.rb +8 -14
  57. data/lib/fuby/to_slash_case.rb +26 -0
  58. data/lib/fuby/tok.rb +0 -1
  59. data/lib/fuby/try_each.rb +1 -0
  60. data/lib/fuby/try_eval.rb +1 -0
  61. data/lib/fuby/unshift_options.rb +1 -0
  62. data/lib/fuby/western_name.rb +11 -0
  63. data/test/fuby/alias_method.rb +2 -2
  64. data/test/fuby/ancestors.rb +41 -0
  65. data/test/fuby/cardinality.rb +34 -0
  66. data/test/fuby/curry_eval.rb +3 -0
  67. data/test/fuby/deep.rb +1 -0
  68. data/test/fuby/deep_each.rb +22 -0
  69. data/test/fuby/define.rb +1 -0
  70. data/test/fuby/define_tok.rb +3 -0
  71. data/test/fuby/descendants.rb +56 -0
  72. data/test/fuby/drop_until.rb +18 -18
  73. data/test/fuby/drop_while.rb +18 -18
  74. data/test/fuby/each.rb +1 -0
  75. data/test/fuby/eql.rb +1 -0
  76. data/test/fuby/eql_componentwise.rb +4 -0
  77. data/test/fuby/equivalence.rb +14 -0
  78. data/test/fuby/eval.rb +1 -0
  79. data/test/fuby/extend.rb +1 -1
  80. data/test/fuby/format.rb +3 -0
  81. data/test/fuby/hash_eval.rb +3 -0
  82. data/test/fuby/include.rb +1 -1
  83. data/test/fuby/index_or_key.rb +3 -0
  84. data/test/fuby/invert.rb +22 -0
  85. data/test/fuby/longest_common.rb +1 -0
  86. data/test/fuby/longest_common_prefix.rb +3 -0
  87. data/test/fuby/longest_common_suffix.rb +3 -0
  88. data/test/fuby/matches.rb +5 -0
  89. data/test/fuby/matches_part_of.rb +3 -0
  90. data/test/fuby/matches_prefix_of.rb +3 -0
  91. data/test/fuby/matches_suffix_of.rb +3 -0
  92. data/test/fuby/new.rb +19 -0
  93. data/test/fuby/part_of.rb +5 -0
  94. data/test/fuby/prefix_of.rb +5 -0
  95. data/test/fuby/prepend.rb +1 -1
  96. data/test/fuby/private.rb +3 -0
  97. data/test/fuby/protected.rb +3 -0
  98. data/test/fuby/public.rb +3 -0
  99. data/test/fuby/push.rb +1 -0
  100. data/test/fuby/random.rb +3 -0
  101. data/test/fuby/self_and_descendants.rb +3 -0
  102. data/test/fuby/shift.rb +5 -0
  103. data/test/fuby/shift_if.rb +3 -0
  104. data/test/fuby/shift_options.rb +3 -0
  105. data/test/fuby/shift_unless.rb +3 -0
  106. data/test/fuby/shift_until.rb +3 -0
  107. data/test/fuby/shift_while.rb +3 -0
  108. data/test/fuby/splat.rb +3 -0
  109. data/test/fuby/strip.rb +3 -0
  110. data/test/fuby/suffix_of.rb +5 -0
  111. data/test/fuby/take.rb +5 -0
  112. data/test/fuby/take_until.rb +3 -0
  113. data/test/fuby/take_while.rb +3 -0
  114. data/test/fuby/to_components.rb +3 -0
  115. data/test/fuby/to_dot_case.rb +15 -0
  116. data/test/fuby/to_slash_case.rb +15 -0
  117. data/test/fuby/to_tok.rb +3 -0
  118. data/test/fuby/tok.rb +1 -0
  119. data/test/fuby/tok_arity.rb +3 -0
  120. data/test/fuby/tok_direction.rb +3 -0
  121. data/test/fuby/tok_parity.rb +3 -0
  122. data/test/fuby/tok_side.rb +3 -0
  123. data/test/fuby/try.rb +52 -52
  124. data/test/fuby/try_each.rb +1 -1
  125. data/test/fuby/try_eval.rb +2 -2
  126. data/test/fuby/unshift.rb +3 -0
  127. data/test/fuby/unshift_options.rb +3 -0
  128. metadata +50 -24
  129. data/lib/fuby/attributes.rb +0 -15
  130. data/lib/fuby/class_attributes.rb +0 -37
  131. data/lib/fuby/dimension.rb +0 -23
  132. data/lib/fuby/instance_attributes.rb +0 -37
  133. data/lib/fuby/try_exec.rb +0 -16
  134. data/test/fuby/attributes.rb +0 -0
  135. data/test/fuby/class_attributes.rb +0 -0
  136. data/test/fuby/dimension.rb +0 -0
  137. data/test/fuby/instance_attributes.rb +0 -0
  138. data/test/fuby/try_exec.rb +0 -0
@@ -5,7 +5,7 @@ using Fuby
5
5
  describe Object do
6
6
  describe :try_eval do
7
7
  describe [Proc] do
8
- it "evals the block_given in self, chaining each method as a try, returning the result" do
8
+ it "evals the block_given in self, chaining each method as a send, returning the result" do
9
9
 
10
10
  arr = [1, 2, 3]
11
11
  arr.try_eval { self }.must_be_same_as arr
@@ -19,7 +19,7 @@ describe Object do
19
19
  end
20
20
  describe :try_eval? do
21
21
  describe [Proc] do
22
- it "evals the block_given in self, chaining each method as a try, returning the result or the original object (if the result is nil)" do
22
+ it "evals the block_given in self, chaining each method as a send, returning the result or the original object (if the result is nil)" do
23
23
 
24
24
  arr = [1, 2, 3]
25
25
  arr.try_eval? { self }.must_be_same_as arr
@@ -0,0 +1,3 @@
1
+ require 'fuby/unshift'
2
+
3
+ using Fuby
@@ -0,0 +1,3 @@
1
+ require 'fuby/unshift_options'
2
+
3
+ using Fuby
metadata CHANGED
@@ -1,25 +1,25 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Goldsmith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-20 00:00:00.000000000 Z
11
+ date: 2014-12-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Lightweight extensions to the Ruby standard library provided by the refinements
14
14
  mechanism.
15
15
  email:
16
- - alex.k.goldsmith@gmail.com
16
+ - alex.tosyx@gmail.com
17
17
  executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
- - .gitignore
22
- - .ruby-version
21
+ - ".gitignore"
22
+ - ".ruby-version"
23
23
  - Gemfile
24
24
  - LICENSE.txt
25
25
  - README.md
@@ -30,37 +30,46 @@ files:
30
30
  - lib/fuby/_.rb
31
31
  - lib/fuby/abbreviation.rb
32
32
  - lib/fuby/alias_method.rb
33
+ - lib/fuby/alias_singleton_method.rb
33
34
  - lib/fuby/all.rb
35
+ - lib/fuby/ancestors.rb
34
36
  - lib/fuby/and.rb
35
37
  - lib/fuby/any.rb
36
- - lib/fuby/attributes.rb
37
38
  - lib/fuby/bind.rb
38
- - lib/fuby/class_attributes.rb
39
+ - lib/fuby/cardinality.rb
40
+ - lib/fuby/curry_eval.rb
39
41
  - lib/fuby/deep.rb
42
+ - lib/fuby/deep_const_get.rb
40
43
  - lib/fuby/deep_each.rb
44
+ - lib/fuby/define.rb
41
45
  - lib/fuby/define_instance_method.rb
42
46
  - lib/fuby/define_missing_method.rb
43
47
  - lib/fuby/define_object_method.rb
44
48
  - lib/fuby/define_tok.rb
45
49
  - lib/fuby/descendants.rb
46
- - lib/fuby/dimension.rb
47
50
  - lib/fuby/drop.rb
48
51
  - lib/fuby/drop_until.rb
49
52
  - lib/fuby/drop_while.rb
50
53
  - lib/fuby/each.rb
51
54
  - lib/fuby/each_with_index_or_key.rb
55
+ - lib/fuby/eastern_name.rb
56
+ - lib/fuby/enumerables.rb
52
57
  - lib/fuby/eql.rb
53
58
  - lib/fuby/eql_componentwise.rb
54
59
  - lib/fuby/equivalence.rb
55
60
  - lib/fuby/eval.rb
56
61
  - lib/fuby/extend.rb
62
+ - lib/fuby/first.rb
57
63
  - lib/fuby/format.rb
64
+ - lib/fuby/hash_eval.rb
58
65
  - lib/fuby/include.rb
59
66
  - lib/fuby/index_or_key.rb
60
- - lib/fuby/instance_attributes.rb
61
67
  - lib/fuby/intercept.rb
62
68
  - lib/fuby/invert.rb
69
+ - lib/fuby/last.rb
63
70
  - lib/fuby/longest_common.rb
71
+ - lib/fuby/longest_common_prefix.rb
72
+ - lib/fuby/longest_common_suffix.rb
64
73
  - lib/fuby/matches.rb
65
74
  - lib/fuby/matches_componentwise.rb
66
75
  - lib/fuby/matches_part_of.rb
@@ -72,11 +81,13 @@ files:
72
81
  - lib/fuby/method_added_as.rb
73
82
  - lib/fuby/method_added_as_binary_operator.rb
74
83
  - lib/fuby/method_added_as_filter.rb
84
+ - lib/fuby/names.rb
75
85
  - lib/fuby/new.rb
76
86
  - lib/fuby/not.rb
77
87
  - lib/fuby/opposite.rb
78
88
  - lib/fuby/or.rb
79
89
  - lib/fuby/otherwise.rb
90
+ - lib/fuby/outer_module.rb
80
91
  - lib/fuby/part_of.rb
81
92
  - lib/fuby/plus.rb
82
93
  - lib/fuby/pop.rb
@@ -94,13 +105,17 @@ files:
94
105
  - lib/fuby/push.rb
95
106
  - lib/fuby/push_options.rb
96
107
  - lib/fuby/random.rb
108
+ - lib/fuby/reject.rb
109
+ - lib/fuby/select.rb
97
110
  - lib/fuby/self_and_descendants.rb
111
+ - lib/fuby/send.rb
98
112
  - lib/fuby/shift.rb
99
113
  - lib/fuby/shift_if.rb
100
114
  - lib/fuby/shift_options.rb
101
115
  - lib/fuby/shift_unless.rb
102
116
  - lib/fuby/shift_until.rb
103
117
  - lib/fuby/shift_while.rb
118
+ - lib/fuby/singleton_method_defined.rb
104
119
  - lib/fuby/splat.rb
105
120
  - lib/fuby/strip.rb
106
121
  - lib/fuby/subclass.rb
@@ -117,10 +132,12 @@ files:
117
132
  - lib/fuby/to_case.rb
118
133
  - lib/fuby/to_components.rb
119
134
  - lib/fuby/to_dash_case.rb
135
+ - lib/fuby/to_dot_case.rb
120
136
  - lib/fuby/to_hash.rb
121
137
  - lib/fuby/to_pred.rb
122
138
  - lib/fuby/to_proc.rb
123
139
  - lib/fuby/to_regexp.rb
140
+ - lib/fuby/to_slash_case.rb
124
141
  - lib/fuby/to_snake_case.rb
125
142
  - lib/fuby/to_tok.rb
126
143
  - lib/fuby/tok.rb
@@ -131,27 +148,28 @@ files:
131
148
  - lib/fuby/try.rb
132
149
  - lib/fuby/try_each.rb
133
150
  - lib/fuby/try_eval.rb
134
- - lib/fuby/try_exec.rb
135
151
  - lib/fuby/unabbreviation.rb
136
152
  - lib/fuby/unshift.rb
137
153
  - lib/fuby/unshift_options.rb
138
154
  - lib/fuby/uuid.rb
155
+ - lib/fuby/western_name.rb
139
156
  - test/fuby/abbreviation.rb
140
157
  - test/fuby/alias_method.rb
141
158
  - test/fuby/all.rb
159
+ - test/fuby/ancestors.rb
142
160
  - test/fuby/and.rb
143
161
  - test/fuby/any.rb
144
- - test/fuby/attributes.rb
145
162
  - test/fuby/bind.rb
146
- - test/fuby/class_attributes.rb
163
+ - test/fuby/cardinality.rb
164
+ - test/fuby/curry_eval.rb
147
165
  - test/fuby/deep.rb
148
166
  - test/fuby/deep_each.rb
167
+ - test/fuby/define.rb
149
168
  - test/fuby/define_instance_method.rb
150
169
  - test/fuby/define_missing_method.rb
151
170
  - test/fuby/define_object_method.rb
152
171
  - test/fuby/define_tok.rb
153
172
  - test/fuby/descendants.rb
154
- - test/fuby/dimension.rb
155
173
  - test/fuby/drop.rb
156
174
  - test/fuby/drop_until.rb
157
175
  - test/fuby/drop_while.rb
@@ -163,14 +181,17 @@ files:
163
181
  - test/fuby/eval.rb
164
182
  - test/fuby/extend.rb
165
183
  - test/fuby/format.rb
184
+ - test/fuby/hash_eval.rb
166
185
  - test/fuby/include.rb
167
186
  - test/fuby/index_or_key.rb
168
- - test/fuby/instance_attributes.rb
169
187
  - test/fuby/intercept.rb
170
188
  - test/fuby/invert.rb
171
189
  - test/fuby/longest_common.rb
190
+ - test/fuby/longest_common_prefix.rb
191
+ - test/fuby/longest_common_suffix.rb
172
192
  - test/fuby/matches.rb
173
193
  - test/fuby/matches_componentwise.rb
194
+ - test/fuby/matches_part_of.rb
174
195
  - test/fuby/matches_prefix_of.rb
175
196
  - test/fuby/matches_suffix_of.rb
176
197
  - test/fuby/member.rb
@@ -221,10 +242,12 @@ files:
221
242
  - test/fuby/to_camel_case.rb
222
243
  - test/fuby/to_components.rb
223
244
  - test/fuby/to_dash_case.rb
245
+ - test/fuby/to_dot_case.rb
224
246
  - test/fuby/to_hash.rb
225
247
  - test/fuby/to_pred.rb
226
248
  - test/fuby/to_proc.rb
227
249
  - test/fuby/to_regexp.rb
250
+ - test/fuby/to_slash_case.rb
228
251
  - test/fuby/to_snake_case.rb
229
252
  - test/fuby/to_tok.rb
230
253
  - test/fuby/tok.rb
@@ -235,7 +258,6 @@ files:
235
258
  - test/fuby/try.rb
236
259
  - test/fuby/try_each.rb
237
260
  - test/fuby/try_eval.rb
238
- - test/fuby/try_exec.rb
239
261
  - test/fuby/unabbreviation.rb
240
262
  - test/fuby/unshift.rb
241
263
  - test/fuby/unshift_options.rb
@@ -250,17 +272,17 @@ require_paths:
250
272
  - lib
251
273
  required_ruby_version: !ruby/object:Gem::Requirement
252
274
  requirements:
253
- - - '>='
275
+ - - ">="
254
276
  - !ruby/object:Gem::Version
255
277
  version: '0'
256
278
  required_rubygems_version: !ruby/object:Gem::Requirement
257
279
  requirements:
258
- - - '>='
280
+ - - ">="
259
281
  - !ruby/object:Gem::Version
260
282
  version: '0'
261
283
  requirements: []
262
284
  rubyforge_project:
263
- rubygems_version: 2.0.3
285
+ rubygems_version: 2.4.4
264
286
  signing_key:
265
287
  specification_version: 4
266
288
  summary: Lightweight extensions to the Ruby standard library
@@ -268,19 +290,20 @@ test_files:
268
290
  - test/fuby/abbreviation.rb
269
291
  - test/fuby/alias_method.rb
270
292
  - test/fuby/all.rb
293
+ - test/fuby/ancestors.rb
271
294
  - test/fuby/and.rb
272
295
  - test/fuby/any.rb
273
- - test/fuby/attributes.rb
274
296
  - test/fuby/bind.rb
275
- - test/fuby/class_attributes.rb
297
+ - test/fuby/cardinality.rb
298
+ - test/fuby/curry_eval.rb
276
299
  - test/fuby/deep.rb
277
300
  - test/fuby/deep_each.rb
301
+ - test/fuby/define.rb
278
302
  - test/fuby/define_instance_method.rb
279
303
  - test/fuby/define_missing_method.rb
280
304
  - test/fuby/define_object_method.rb
281
305
  - test/fuby/define_tok.rb
282
306
  - test/fuby/descendants.rb
283
- - test/fuby/dimension.rb
284
307
  - test/fuby/drop.rb
285
308
  - test/fuby/drop_until.rb
286
309
  - test/fuby/drop_while.rb
@@ -292,14 +315,17 @@ test_files:
292
315
  - test/fuby/eval.rb
293
316
  - test/fuby/extend.rb
294
317
  - test/fuby/format.rb
318
+ - test/fuby/hash_eval.rb
295
319
  - test/fuby/include.rb
296
320
  - test/fuby/index_or_key.rb
297
- - test/fuby/instance_attributes.rb
298
321
  - test/fuby/intercept.rb
299
322
  - test/fuby/invert.rb
300
323
  - test/fuby/longest_common.rb
324
+ - test/fuby/longest_common_prefix.rb
325
+ - test/fuby/longest_common_suffix.rb
301
326
  - test/fuby/matches.rb
302
327
  - test/fuby/matches_componentwise.rb
328
+ - test/fuby/matches_part_of.rb
303
329
  - test/fuby/matches_prefix_of.rb
304
330
  - test/fuby/matches_suffix_of.rb
305
331
  - test/fuby/member.rb
@@ -350,10 +376,12 @@ test_files:
350
376
  - test/fuby/to_camel_case.rb
351
377
  - test/fuby/to_components.rb
352
378
  - test/fuby/to_dash_case.rb
379
+ - test/fuby/to_dot_case.rb
353
380
  - test/fuby/to_hash.rb
354
381
  - test/fuby/to_pred.rb
355
382
  - test/fuby/to_proc.rb
356
383
  - test/fuby/to_regexp.rb
384
+ - test/fuby/to_slash_case.rb
357
385
  - test/fuby/to_snake_case.rb
358
386
  - test/fuby/to_tok.rb
359
387
  - test/fuby/tok.rb
@@ -364,9 +392,7 @@ test_files:
364
392
  - test/fuby/try.rb
365
393
  - test/fuby/try_each.rb
366
394
  - test/fuby/try_eval.rb
367
- - test/fuby/try_exec.rb
368
395
  - test/fuby/unabbreviation.rb
369
396
  - test/fuby/unshift.rb
370
397
  - test/fuby/unshift_options.rb
371
398
  - test/fuby/uuid.rb
372
- has_rdoc:
@@ -1,15 +0,0 @@
1
- require 'delegate'
2
-
3
- module Fuby
4
- class Attributes < SimpleDelegator
5
-
6
- def [] key
7
- __getobj__.send :"#{ __name__ }_get", key
8
- end
9
-
10
- def []= key, val
11
- __getobj__.send :"#{ __name__ }_set", key, val
12
- end
13
-
14
- end
15
- end
@@ -1,37 +0,0 @@
1
- require_relative 'attributes'
2
-
3
- module Fuby
4
- refine ::Module do
5
-
6
- def class_attribute_set key, val
7
- (singleton_class.respond_to? :"#{ key }=") ? (singleton_class.send :"#{ key }=", val) : (class_variable_set "@@{ key }", val)
8
- end
9
-
10
- def class_attribute_get key
11
- (respond_to? key) ? (send key) : (class_variable_get :"@@#{ key }")
12
- end
13
-
14
- def class_attributes_set opt
15
- opt.each { |key, val| class_attribute_set key, val }
16
- self
17
- end
18
-
19
- def class_attributes_get *keys
20
- keys.map &(method :class_attribute_get)
21
- end
22
-
23
- alias_method :class_attributes_at, :class_attributes_get
24
-
25
- def class_attributes
26
- ClassAttributes.new self
27
- end
28
-
29
- end
30
- class ClassAttributes < Attributes
31
-
32
- def __name__
33
- :class_attributes
34
- end
35
-
36
- end
37
- end
@@ -1,23 +0,0 @@
1
- module Fuby
2
- refine ::Object do
3
-
4
- def dimension
5
- 1
6
- end
7
-
8
- end
9
- refine ::NilClass do
10
-
11
- def dimension
12
- 0
13
- end
14
-
15
- end
16
- module ::Enumerable # can't refine Module
17
-
18
- def dimension
19
- count
20
- end
21
-
22
- end
23
- end
@@ -1,37 +0,0 @@
1
- require_relative 'attributes'
2
-
3
- module Fuby
4
- refine ::Object do
5
-
6
- def instance_attribute_set key, val
7
- (respond_to? "#{ key }=") ? (send "#{ key }=", val) : (instance_variable_set "@{ key }", val)
8
- end
9
-
10
- def instance_attribute_get key
11
- (respond_to? key) ? (send key) : (instance_variable_get "@#{ key }")
12
- end
13
-
14
- def instance_attributes_set opt
15
- opt.each { |key, val| instance_attribute_set key, val }
16
- self
17
- end
18
-
19
- def instance_attributes_get key
20
- keys.map &(method :instance_attribute_get)
21
- end
22
-
23
- alias_method :instance_attributes_at, :instance_attributes_get
24
-
25
- def instance_attributes
26
- InstanceAttributes.new self
27
- end
28
-
29
- end
30
- class InstanceAttributes < Attributes
31
-
32
- def __name__
33
- :instance_attributes
34
- end
35
-
36
- end
37
- end
@@ -1,16 +0,0 @@
1
- require_relative 'try_eval'
2
- using Fuby
3
-
4
- module Fuby
5
- refine ::Object do
6
-
7
- def try_exec &blk
8
- try_eval &blk
9
- end
10
-
11
- def try_exec? &blk
12
- try_eval? &blk
13
- end
14
-
15
- end
16
- end
File without changes
File without changes
File without changes