mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/yaml/rubytypes.rb: anonymous struct fix. [ruby-core:01946]
* test/yaml/test_yaml.rb: add test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
30e14294a7
commit
ff2a47eb99
3 changed files with 19 additions and 2 deletions
|
|
@ -155,8 +155,8 @@ class Struct
|
|||
#
|
||||
# Basic struct is passed as a YAML map
|
||||
#
|
||||
struct_name = self.class.name.gsub( "Struct:", "" )
|
||||
out.map( "!ruby/struct#{struct_name}" ) { |map|
|
||||
struct_name = self.class.name.gsub( "Struct::", "" )
|
||||
out.map( "!ruby/struct:#{struct_name}" ) { |map|
|
||||
self.members.each { |m|
|
||||
map.add( m, self[m] )
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue