No need to check if YAML::ENGINE is defined since ruby 1.9 does that

上级 e2e4216d
......@@ -319,7 +319,7 @@ def inspect
# Hackery to accomodate Syck. Remove for 4.0.
def to_yaml(opts = {}) #:nodoc:
if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck?
if !YAML::ENGINE.syck?
super
else
coder = {}
......
......@@ -16,7 +16,7 @@ class BigDecimal
#
# Note that reconstituting YAML floats to native floats may lose precision.
def to_yaml(opts = {})
return super if defined?(YAML::ENGINE) && !YAML::ENGINE.syck?
return super if !YAML::ENGINE.syck?
YAML.quick_emit(nil, opts) do |out|
string = to_s
......
......@@ -137,7 +137,7 @@ def encode_with(coder)
end
def to_yaml(*args)
return super() if defined?(YAML::ENGINE) && !YAML::ENGINE.syck?
return super() if !YAML::ENGINE.syck?
to_str.to_yaml(*args)
end
......
......@@ -30,7 +30,7 @@ def encode_with(coder)
end
def to_yaml(opts = {})
if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck?
if !YAML::ENGINE.syck?
return super
end
......
......@@ -147,7 +147,7 @@ def encode_with(coder)
end
def to_yaml(options = {})
return super if defined?(YAML::ENGINE) && !YAML::ENGINE.syck?
return super if !YAML::ENGINE.syck?
utc.to_yaml(options)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册