Module: Ox::Builder

Extended by:
Builder
Included in:
Builder
Defined in:
lib/ox/builder/version.rb,
lib/ox/builder/handler.rb,
lib/ox/builder/proxy.rb,
lib/ox/builder.rb

Defined Under Namespace

Classes: Handler, Proxy

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#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