AST inspection

You can call raw() on a document or any element in it to get a native ruby object serialization of the abstract syntax tree constructed by enolib.

Enolib.parse("> note\ngreeting: hello").raw
# returns {
#   type: :document,
#   elements: [{
#     comment: 'note',
#     key: 'greeting',
#     type: :field,
#     value: 'hello'
#   }]
# }

Although this can theoretically be used to get a plain object dump of an eno document, it is solely intended for debugging purposes, as there is no validation and no types and the serialization structure is rather verbose to work with as well.


Next page: FAQ