Sha256: e9983589d40c377cfbcb84b924d96f9df80e406e70332bffccb96dd28843f6c2

Contents?: true

Size: 536 Bytes

Versions: 9

Compression:

Stored size: 536 Bytes

Contents

require "logstash/namespace"

module LogStash::Filters
  public
  def self.from_name(name, *args)
    # TODO(sissel): Add error handling
    # TODO(sissel): Allow plugin paths
    klass = name.capitalize

    # Load the class if we haven't already.
    require "logstash/filters/#{name}"

    # Get the class name from the Filters namespace and create a new instance.
    # for name == 'foo' this will call LogStash::Filters::Foo.new
    LogStash::Filters.const_get(klass).new(*args)
  end # def from_url
end # module LogStash::Filters

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logstash-lite-0.2.20110505142231 lib/logstash/filters.rb
logstash-lite-0.2.20110422152244 lib/logstash/filters.rb
logstash-lite-0.2.20110405105201 lib/logstash/filters.rb
logstash-lite-0.2.20110331121236 lib/logstash/filters.rb
logstash-lite-0.2.20110329105411 lib/logstash/filters.rb
logstash-lite-0.2.20110206003603 lib/logstash/filters.rb
logstash-lite-0.2.20110203130400 lib/logstash/filters.rb
logstash-lite-0.2.20110122143801 lib/logstash/filters.rb
logstash-lite-0.2.20110112115019 lib/logstash/filters.rb