Skip to content

Instantly share code, notes, and snippets.

@ddlsmurf
Last active May 22, 2021 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddlsmurf/4519361 to your computer and use it in GitHub Desktop.
Save ddlsmurf/4519361 to your computer and use it in GitHub Desktop.
code exercise - render tree #exercise
{"a":{"b":{"c":{"ca":{"caa":true}},"d":true},"e":{"f":true},"g":true},"h":true}
data = ({
:a => {
:b => {
:c => {
:ca => { :caa => true }
},
:d => true
},
:e => { :f => true },
:g => true
},
:h => true
})
---
:a:
:b:
:c:
:ca:
:caa: true
:d: true
:e:
:f: true
:g: true
:h: true
┌─┬ a
│ ├─┬ b
│ │ ├─┬ c
│ │ │ └─┬ ca
│ │ │ └── caa
│ │ └── d
│ ├─┬ e
│ │ └── f
│ └── g
└── h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment