Method: Ox::Builder#document

Defined in:
lib/ox/builder.rb

#document(attributes = {}, options = {}) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/ox/builder.rb', line 6

def document attributes = {}, options = {}
  attributes = default_attributes.merge(attributes.stringify_keys)
  Proxy.new(Ox::Document.new(attributes)).tap do |doc|
    doc.instruct('xml', attributes)
    yield doc if block_given?
  end
end