0.0
No commit activity in last 3 years
No release in over 3 years
Builds a Polyrex structure from an array of Hash objects representing summary records.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.5, >= 0.5.1
 Project Readme

Introducing the Polyrex-builder gem

Usage:

require 'polyrex-builder'

r = [
  [{name: 'buzz'},
    [
      [{string: 'hpx'},
        [
          [{line: '12', command: 'pwd'}],
          [{line: '13', command: 'format'}]
        ]
      ] 
    ]
  ]
]

pb = PolyrexBuilder.new(r, parents: %i(entry extension instruction))
puts pb.to_xml

The Polyrex-builder gem accepts a nested array of Hash objects, each represent a summary record. It then generates the XML or an array object (for parsing by the Rexle object) representing a Polyrex document.

Output:

<?xml version='1.0' encoding='UTF-8'?>
<root>
  <records>
    <entry>
      <summary>
        <name>buzz</name>
      </summary>
      <records>
        <extension>
          <summary>
            <string>hpx</string>
          </summary>
          <records>
            <instruction>
              <summary>
                <line>12</line>
                <command>pwd</command>
              </summary>
            </instruction>
            <instruction>
              <summary>
                <line>13</line>
                <command>format</command>
              </summary>
            </instruction>
          </records>
        </extension>
      </records>
    </entry>
  </records>
</root>

Resources

polyrexbuilder gem polyrex builder records