[ruby/psych] Extract accessor methods without forwardable
We should leave additional dependency if we leave from them. https://github.com/ruby/psych/commit/3d0325a774
This commit is contained in:
parent
62b4983416
commit
1e7ddfa7ea
@ -696,9 +696,6 @@ module Psych
|
|||||||
|
|
||||||
class << self
|
class << self
|
||||||
if defined?(Ractor)
|
if defined?(Ractor)
|
||||||
require 'forwardable'
|
|
||||||
extend Forwardable
|
|
||||||
|
|
||||||
class Config
|
class Config
|
||||||
attr_accessor :load_tags, :dump_tags, :domain_types
|
attr_accessor :load_tags, :dump_tags, :domain_types
|
||||||
def initialize
|
def initialize
|
||||||
@ -712,7 +709,29 @@ module Psych
|
|||||||
Ractor.current[:PsychConfig] ||= Config.new
|
Ractor.current[:PsychConfig] ||= Config.new
|
||||||
end
|
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
|
else
|
||||||
attr_accessor :load_tags
|
attr_accessor :load_tags
|
||||||
attr_accessor :dump_tags
|
attr_accessor :dump_tags
|
||||||
|
Loading…
x
Reference in New Issue
Block a user