module NginxTail::HttpVersion

Public Class Methods

major_version(http_version) click to toggle source
# File lib/ntail/http_version.rb, line 13
def self.major_version(http_version)
  return $1 if http_version =~ @@http_version_expression
end
minor_version(http_version) click to toggle source
# File lib/ntail/http_version.rb, line 9
def self.minor_version(http_version)
  return $1 if http_version =~ @@http_version_expression
end
to_http_version_s(http_version, which = :full) click to toggle source
# File lib/ntail/http_version.rb, line 17
def self.to_http_version_s(http_version, which = :full)
  # http_version will be nil if $request == "-" (ie. "dodgy" HTTP requests)
  http_version.nil? ? "" : case which
    when :full then http_version
    when :major then self.major_version(http_version)
    when :minor then self.minor_version(http_version)
  end
end

Public Instance Methods

to_http_version_s(which = :full) click to toggle source
# File lib/ntail/http_version.rb, line 32
def to_http_version_s(which = :full)
  self.class.to_http_version_s(self.http_version, which)
end