Sha256: 8b8b265a9f54ddc6d9f14f70c49bce5f12b570e351faf4d77154d302f619bec4

Contents?: true

Size: 972 Bytes

Versions: 4

Compression:

Stored size: 972 Bytes

Contents

module RequestLogAnalyzer::Filter
  
  # Filter class loader using const_missing
  # This function will automatically load the class file based on the name of the class
  def self.const_missing(const)
    RequestLogAnalyzer::load_default_class_file(self, const)
  end
  
  # Base filter class used to filter input requests.
  # All filters should interit from this base.  
  class Base
    
    include RequestLogAnalyzer::FileFormat::Awareness
    
    attr_reader :log_parser
    attr_reader :options
    
    # Initializer
    # <tt>format</tt> The file format
    # <tt>options</tt> Are passed to the filters.
    def initialize(format, options = {})
      @options    = options
      register_file_format(format)
    end
    
    # Initialize the filter
    def prepare
    end
    
    # Return the request if the request should be kept.
    # Return nil otherwise.
    def filter(request)
      return nil unless request
      return request
    end   
  end
  
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
wvanbergen-request-log-analyzer-1.1.1 lib/request_log_analyzer/filter.rb
wvanbergen-request-log-analyzer-1.1.2 lib/request_log_analyzer/filter.rb
request-log-analyzer-1.1.1 lib/request_log_analyzer/filter.rb
request-log-analyzer-1.1.2 lib/request_log_analyzer/filter.rb