summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2023-07-05 18:47:41 +0900
committergit <[email protected]>2023-07-05 10:11:36 +0000
commit1e7ddfa7eaa9834f958db0646457e00b27ef4976 (patch)
treeee6cc33eea027e4dce525a603490118fceacf2c8
parent62b4983416022d3b286b5b1f9fbd908e9a0cfb6d (diff)
[ruby/psych] Extract accessor methods without forwardable
We should leave additional dependency if we leave from them. https://github.com/ruby/psych/commit/3d0325a774
-rw-r--r--ext/psych/lib/psych.rb27
1 files changed, 23 insertions, 4 deletions
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb
index 9e21325cff..ae167472f2 100644
--- a/ext/psych/lib/psych.rb
+++ b/ext/psych/lib/psych.rb
@@ -696,9 +696,6 @@ module Psych
class << self
if defined?(Ractor)
- require 'forwardable'
- extend Forwardable
-
class Config
attr_accessor :load_tags, :dump_tags, :domain_types
def initialize
@@ -712,7 +709,29 @@ module Psych
Ractor.current[:PsychConfig] ||= Config.new
end
- def_delegators :config, :load_tags, :dump_tags, :domain_types, :load_tags=, :dump_tags=, :domain_types=
+ def load_tags
+ config.load_tags
+ end
+
+ def dump_tags
+ config.dump_tags
+ end
+
+ def domain_types
+ config.domain_types
+ end
+
+ def load_tags=(value)
+ config.load_tags = value
+ end
+
+ def dump_tags=(value)
+ config.dump_tags = value
+ end
+
+ def domain_types=(value)
+ config.domain_types = value
+ end
else
attr_accessor :load_tags
attr_accessor :dump_tags