Class: PolyrexBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/polyrex-builder.rb

Instance Method Summary collapse

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_aObject



22
23
24
# File 'lib/polyrex-builder.rb', line 22

def to_a()
  @a
end

#to_xmlObject



26
27
28
# File 'lib/polyrex-builder.rb', line 26

def to_xml()  
  Rexle.new(@a).xml pretty: true    
end