Module: Pacer

Defined in:
lib/pacer-xml.rb,
lib/pacer-xml/string_route.rb

Defined Under Namespace

Modules: Core

Class Method Summary collapse

Class Method Details

.xml(file, enter = nil, leave = nil, &block) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/pacer-xml.rb', line 40

def xml(file, enter = nil, leave = nil, &block)
  if file.is_a? String
    file = File.open file
  end
  lines = file.each_line.to_route(element_type: :string, info: 'lines').route
  lines.xml_stream(enter, leave, &block).route
end