Class: ApacheCrunch::TokenDictionary

Inherits:
Object
  • Object
show all
Defined in:
lib/format_token_definition.rb

Overview

Finds log format elements given information about them.

Constant Summary collapse

@@_defs =
[
        RemoteHostTokenDefinition,
        LogNameTokenDefinition,
        RemoteUserTokenDefinition,
        TimeTokenDefinition,
        ReqFirstlineTokenDefinition,
        StatusTokenDefinition,
        BytesSentTokenDefinition,
        BytesSentTokenDefinition,
        BytesSentWithHeadersTokenDefinition,
        ServeTimeMicroTokenDefinition,
        UrlPathTokenDefinition,
        QueryStringTokenDefinition,
        ReqMethodTokenDefinition,
        ProtocolTokenDefinition
]

Class Method Summary collapse

Class Method Details

.fetch(abbrev) ⇒ Object

Returns the FormatToken subclass with the given abbreviation.

If none exists, returns nil.



173
174
175
176
177
178
179
180
181
# File 'lib/format_token_definition.rb', line 173

def self.fetch(abbrev)
    @@_defs.each do |token_def|
        if token_def.abbrev == abbrev
            return token_def
        end
    end

    nil
end