Sha256: 27077aefa30c246d45a618f85e495d8e26522ad94da5f39233bea20821a25370

Contents?: true

Size: 944 Bytes

Versions: 2

Compression:

Stored size: 944 Bytes

Contents

#### Circular Hashes

This example shows hashes that make a circular reference.

```show.rb```:
```ruby
require 'debug_helper'

hash_0 = {}
hash_1 = {}
hash_0.store(:foo, hash_1)
hash_1.store(:bar, hash_0)
DebugHelper.show(hash_0, 'My circular hashes')
```

The output shows details of the hashes.

The circular reference is not followed.

```show.yaml```:
```yaml
---
Hash (message='My circular hashes'):
  Hash#size: 1
  Hash#default: 
  Hash#default_proc: 
  Pair 0:
    Key:
      Symbol:
        Symbol#to_s: foo
        Symbol#size: 3
        Symbol#encoding: !ruby/encoding US-ASCII
    Value:
      Hash:
        Hash#size: 1
        Hash#default: 
        Hash#default_proc: 
        Pair 0:
          Key:
            Symbol:
              Symbol#to_s: bar
              Symbol#size: 3
              Symbol#encoding: !ruby/encoding US-ASCII
          Value: Hash {:foo=>{:bar=>{...}}}
```

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
debug_helper-2.1.0 markdown/readme/classes/hash/circular/show.md
debug_helper-2.0.0 markdown/readme/classes/hash/circular/show.md