Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ext/syck/lib/syck/rubytypes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ def to_yaml( opts = {} )
class Exception
yaml_as "tag:ruby.yaml.org,2002:exception"
def Exception.yaml_new( klass, tag, val )
o = YAML.object_maker( klass, { 'mesg' => val.delete( 'message' ) } )
o = klass.allocate
Exception.instance_method(:initialize).
bind(o).
call( val.delete( 'message' ) )
val.each_pair do |k,v|
o.instance_variable_set("@#{k}", v)
end
Expand Down
2 changes: 1 addition & 1 deletion test/syck/test_exception.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize *args
end

def setup
@wups = Wups.new
@wups = Wups.new('test_message')
end

def test_to_yaml
Expand Down