[#106355] [Ruby master Bug#18373] RBS build failure: '/include/x86_64-linux/ruby/config.h', needed by 'constants.o'. — "vo.x (Vit Ondruch)" <noreply@...>
Issue #18373 has been reported by vo.x (Vit Ondruch).
28 messages
2021/12/01
[ruby-core:106612] [Ruby master Feature#12737] Module#defined_refinements
From:
"shugo (Shugo Maeda)" <noreply@...>
Date:
2021-12-10 04:43:26 UTC
List:
ruby-core #106612
Issue #12737 has been updated by shugo (Shugo Maeda).
Assignee set to shugo (Shugo Maeda)
----------------------------------------
Feature #12737: Module#defined_refinements
https://bugs.ruby-lang.org/issues/12737#change-95281
* Author: shugo (Shugo Maeda)
* Status: Assigned
* Priority: Normal
* Assignee: shugo (Shugo Maeda)
----------------------------------------
How about to provide Module#defined_refinements, which returns the refinements defined in the receiver as a Hash, as follows:
```
module M
refine String do
$M_String = self
end
refine Integer do
$M_Integer = self
end
end
p M.defined_refinements #=> {String => $M_String, Integer => $M_Integer}
```
By `Module#defined_refinements`, you can activate refinements globally:
```
for klass, refinement in M.defined_refinements
klass.prepend(refinement)
end
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>