psych
psych copied to clipboard
`ruby/object:*` tag not used for scalar value
class Custom
def initialize
@value = 1
end
def encode_with(coder)
coder.scalar = @value.to_s
end
def init_with(coder)
@value = coder.scalar.to_i
end
end
YAML::load(YAML::dump(Custom.new)) # => 1
Would expect that to return a Custom since dump emits the correct tag, bug instead get 1