mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/psych] Avoid methods depending on bindings
Improves Ractor-readiness.
This commit is contained in:
parent
0eb94dae4a
commit
d1963adae8
Notes:
git
2020-12-23 15:09:03 +09:00
1 changed files with 5 additions and 3 deletions
|
@ -35,9 +35,11 @@ module Psych
|
|||
|
||||
constants.each do |const|
|
||||
konst = const_get const
|
||||
define_method(const.to_s.downcase) do
|
||||
load konst
|
||||
end
|
||||
class_eval <<~RUBY
|
||||
def #{const.to_s.downcase}
|
||||
load #{konst.inspect}
|
||||
end
|
||||
RUBY
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue