summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-03-10 11:07:57 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-03-27 10:10:44 +0900
commitaf66b0a291ce0639ef39952f6d4ffbc13eaaa6e6 (patch)
tree8e92149a2acd6abe586620241e5cc17b04ec07f3
parentc984a2c7dfc79234d7375442ccfb6d51a363e783 (diff)
downloadpsych-af66b0a291ce0639ef39952f6d4ffbc13eaaa6e6.tar.gz
Remove Psych.object_maker
-rw-r--r--lib/psych/deprecated.rb7
-rw-r--r--test/psych/test_deprecated.rb7
2 files changed, 0 insertions, 14 deletions
diff --git a/lib/psych/deprecated.rb b/lib/psych/deprecated.rb
index adb3fc9..34236ef 100644
--- a/lib/psych/deprecated.rb
+++ b/lib/psych/deprecated.rb
@@ -14,13 +14,6 @@ module Psych
return thing unless String === thing
"tag:yaml.org,2002:#{thing}"
end
-
- def self.object_maker klass, hash
- warn "#{caller[0]}: object_maker is deprecated" if $VERBOSE
- klass.allocate.tap do |obj|
- hash.each { |k,v| obj.instance_variable_set(:"@#{k}", v) }
- end
- end
end
class Object
diff --git a/test/psych/test_deprecated.rb b/test/psych/test_deprecated.rb
index 47cf984..b83f325 100644
--- a/test/psych/test_deprecated.rb
+++ b/test/psych/test_deprecated.rb
@@ -127,12 +127,5 @@ module Psych
assert_equal Psych, Psych.tagurize(Psych)
assert_equal 'tag:yaml.org,2002:foo', Psych.tagurize('foo')
end
-
- def test_object_maker
- thing = Psych.object_maker(Object, { 'a' => 'b', 'c' => 'd' })
- assert_instance_of(Object, thing)
- assert_equal 'b', thing.instance_variable_get(:@a)
- assert_equal 'd', thing.instance_variable_get(:@c)
- end
end
end