Class: PolyrexBuilder
- Inherits:
-
Object
- Object
- PolyrexBuilder
- Defined in:
- lib/polyrex-builder.rb
Instance Method Summary collapse
-
#initialize(rows = [], parents: []) ⇒ PolyrexBuilder
constructor
A new instance of PolyrexBuilder.
- #to_a ⇒ Object
- #to_xml ⇒ Object
Constructor Details
#initialize(rows = [], parents: []) ⇒ PolyrexBuilder
Returns a new instance of PolyrexBuilder.
12 13 14 15 16 17 18 19 20 |
# File 'lib/polyrex-builder.rb', line 12 def initialize(rows=[], parents: []) records = rows.map {|x| pxify(x, parents) } h = {records: records } @a = RexleBuilder.new(h).to_a end |
Instance Method Details
#to_a ⇒ Object
22 23 24 |
# File 'lib/polyrex-builder.rb', line 22 def to_a() @a end |
#to_xml ⇒ Object
26 27 28 |
# File 'lib/polyrex-builder.rb', line 26 def to_xml() Rexle.new(@a).xml pretty: true end |