Method: Fabulator::Compiler#compile
- Defined in:
- lib/fabulator/compiler.rb
#compile(xml) ⇒ Object
Calls the right compiler object based on the root element
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fabulator/compiler.rb', line 10 def compile(xml) XML.default_line_numbers = true doc = nil if xml.is_a?(String) doc = LibXML::XML::Document.string xml doc = doc.root elsif xml.is_a?(LibXML::XML::Document) doc = xml.root else doc = xml end @context.compile_structural(doc) end |