Sha256: d2dfb5535ab177f51260234e311824b49cacc361de62c23ef82106e73d817a62

Contents?: true

Size: 597 Bytes

Versions: 5

Compression:

Stored size: 597 Bytes

Contents

module NginxTail
  module HttpVersion
    
    def self.included(base) # :nodoc:
      base.class_eval do

        def self.to_http_version_s(http_version)
          http_version || "" # will be nil if $request == "-" (ie. "dodgy" HTTP requests)
        end

        # this ensures the below module methods actually make sense...
        raise "Class #{base.name} should implement instance method 'http_version'" unless base.instance_methods.include? 'http_version'
        
      end
    end

    def to_http_version_s
      self.class.to_http_version_s(self.http_version)
    end
    
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ntail-0.0.11 lib/ntail/http_version.rb
ntail-0.0.10 lib/ntail/http_version.rb
ntail-0.0.9 lib/ntail/http_version.rb
ntail-0.0.8 lib/ntail/http_version.rb
ntail-0.0.7 lib/ntail/http_version.rb