class method
JSON.deprecated_singleton_attr_accessor
deprecated_singleton_attr_accessor(*attrs)
ext/json/lib/json/common.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/ext/json/lib/json/common.rb, line 203
def deprecated_singleton_attr_accessor(*attrs)
args = RUBY_VERSION >= "3.0" ? ", category: :deprecated" : ""
attrs.each do |attr|
singleton_class.class_eval <<~RUBY
def #{attr}
warn "JSON.#{attr} is deprecated and will be removed in json 3.0.0", uplevel: 1 #{args}
@#{attr}
end
def #{attr}=(val)
warn "JSON.#{attr}= is deprecated and will be removed in json 3.0.0", uplevel: 1 #{args}
@#{attr} = val
end
def _#{attr}
@#{attr}
end
RUBY
end
end
No documentation available