Method: Representable::XML#to_node

Defined in:
lib/representable/xml.rb

#to_node(options = {}) ⇒ Object

Returns a Nokogiri::XML object representing this object.



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

def to_node(options={})
  options[:doc] ||= Nokogiri::XML::Document.new
  root_tag = options[:wrap] || representation_wrap(options)

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