FIXME: remove this method once “to_yaml_properties” is removed
# File ext/psych/lib/psych/visitors/yaml_tree.rb, line 387
def find_ivars target
begin
loc = target.method(:to_yaml_properties).source_location.first
unless loc.start_with?(Psych::DEPRECATED) || loc.end_with?('rubytypes.rb')
if $VERBOSE
warn "#{loc}: to_yaml_properties is deprecated, please implement \"encode_with(coder)\""
end
return target.to_yaml_properties
end
rescue
# public_method or source_location might be overridden,
# and it's OK to skip it since it's only to emit a warning.
end
target.instance_variables
end