Sha256: 57c457e3d9f9453b5384e9931395eaac3556fb2f64938c5b1abe7669a6165fab
Contents?: true
Size: 1.49 KB
Versions: 1
Compression:
Stored size: 1.49 KB
Contents
#### Nested Structs This example shows nested structs. ```show.rb```: ```ruby require 'debug_helper' MyStruct_0 = Struct.new(:a, :b) MyStruct_1 = Struct.new(:c, :d) struct_1a = MyStruct_1.new(2, 3) struct_1b = MyStruct_1.new(4, 5) struct_0 = MyStruct_0.new(struct_1a, struct_1b) DebugHelper.show(struct_0, 'My nested struct') ``` The output shows details of the structs. ```show.yaml```: ```yaml --- MyStruct_0 (message='My nested struct'): size: 2 Member 0: Name: Symbol: to_s: a size: 1 encoding: !ruby/encoding US-ASCII Value: MyStruct_1: size: 2 Member 0: Name: Symbol: to_s: c size: 1 encoding: !ruby/encoding US-ASCII Value: Fixnum 2 Member 1: Name: Symbol: to_s: d size: 1 encoding: !ruby/encoding US-ASCII Value: Fixnum 3 Member 1: Name: Symbol: to_s: b size: 1 encoding: !ruby/encoding US-ASCII Value: MyStruct_1: size: 2 Member 0: Name: Symbol: to_s: c size: 1 encoding: !ruby/encoding US-ASCII Value: Fixnum 4 Member 1: Name: Symbol: to_s: d size: 1 encoding: !ruby/encoding US-ASCII Value: Fixnum 5 ```
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
debug_helper-1.8.0 | markdown/readme/classes/struct/nested/show.md |