Actions
Bug #13115
closed`YAML.dump` outputs deperecated message even with delegated object
Description
YAML.dump
outputs deprecated message if it calls with delegated object
but doesn't with inherited object:
require 'yaml'
require 'delegate'
$VERBOSE = true
class Delegated < DelegateClass(Object)
def initialize
super(Object.new)
end
end
puts 'YAML.dump(Delegated.new)'
YAML.dump(Delegated.new)
class Inherited < Object
end
puts 'YAML.dump(Inherited.new)'
YAML.dump(Inherited.new)
# $ ruby test.rb
# YAML.dump(Delegated.new)
# implementing to_yaml is deprecated, please implement "encode_with"
# YAML.dump(Inherited.new)
Is this intentional?
Actions
Like0
Like0Like0