Eno::Fieldset » #elements

elements → array

Retrieve the entries of this fieldset as Eno::Field elements (instead of their direct values) in sequential order. This seamlessly lets you switch from associative readout to sequential readout, allowing fieldsets to also represent document-like structures instead of just associative data.

alice = icetea
bob = peppermint tea
jane = no tea at all
ann = earl grey
rubydocument = Eno.parse(input)
preferences = document.fieldset('preferences')

html = '<h1>Observe these fascinating tea preferences, presented in html!</h1>'

preferences.elements.each do |element|
  html += "<strong>#{element.name}</strong> likes #{element.value}.<br>"

File.write('index.html', html)

Return value

An array containing the elements of this fieldset.