Class: REXML::SourceFactory
- Inherits:
-
Object
- Object
- REXML::SourceFactory
- Defined in:
- lib/logstash/filters/xml/patch_rexml.rb
Class Method Summary collapse
-
.create_from(arg) ⇒ Object
Generates a Source object.
Class Method Details
.create_from(arg) ⇒ Object
Generates a Source object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/logstash/filters/xml/patch_rexml.rb', line 9 def SourceFactory::create_from(arg) if arg.respond_to? :read and arg.respond_to? :readline and arg.respond_to? :nil? and arg.respond_to? :eof? IOSource.new(arg) elsif arg.respond_to? :to_str # remove this require to speed up multi-threaded parsing #require 'stringio' IOSource.new(StringIO.new(arg)) elsif arg.kind_of? Source arg else raise "#{arg.class} is not a valid input stream. It must walk \n"+ "like either a String, an IO, or a Source." end end |