Sha256: b3a86b53aeb8792713d92dc4a4248bfa7406b5ef301ba1bdd77a0da655df48f8

Contents?: true

Size: 872 Bytes

Versions: 1

Compression:

Stored size: 872 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'):
  size: 1
  default: 
  default_proc: 
  Pair 0:
    Key:
      Symbol:
        to_s: foo
        size: 3
        encoding: !ruby/encoding US-ASCII
    Value:
      Hash:
        size: 1
        default: 
        default_proc: 
        Pair 0:
          Key:
            Symbol:
              to_s: bar
              size: 3
              encoding: !ruby/encoding US-ASCII
          Value: Hash {:foo=>{:bar=>{...}}}
```

Version data entries

1 entries across 1 versions & 1 rubygems

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