Method: Representable::XML#to_node

Defined in:
lib/representable/xml.rb

#to_node(options = {}) ⇒ Object

Returns a Nokogiri::XML object representing this object.



47
48
49
50
51
52
# File 'lib/representable/xml.rb', line 47

def to_node(options={})
  options[:doc] = Nokogiri::XML::Document.new # DISCUSS: why do we need a fresh Document here?
  root_tag = options[:wrap] || representation_wrap(options)

  create_representation_with(Node(options[:doc], root_tag.to_s), options, Binding)
end