Eno::Fieldset ยป #enforce_all_elements


Set the default for all following queries on this fieldset of whether the presence of elements in the eno input text should be enforced (by default it is not). This can be used to prevent "template decay" - with presence enforcement enabled entries may be empty, but they (at least their declaration) must be there in the eno document and consequently they can not disappear from a template at any point without triggering an error.

0001 = 1
0010 = 2
rubydocument = Eno.parse(input)

conversions = document.fieldset('conversions')


conversions.entry('0011')  # raises an error
conversions.entry('0011', enforce_element: false)  #=> nil