Class: Racknga::LogEntry — racknga - ラングバ

Class: Racknga::LogEntry

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

Constant Summary

ATTRIBUTES =
[
  :remote_address,
  :remote_user,
  :time_local,
  :runtime,
  :request_time,
  :request,
  :status,
  :body_bytes_sent,
  :http_referer,
  :http_user_agent,
]

Instance Method Summary (collapse)

Constructor Details

- (LogEntry) initialize(options = nil)

A new instance of LogEntry



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/racknga/log_entry.rb', line 36

def initialize(options=nil)
  options ||= {}
  @remote_address = options[:remote_address]
  @remote_user = normalize_string_value(options[:remote_user])
  @time_local = options[:time_local] || Time.at(0)
  @runtime = normalize_float_value(options[:runtime])
  @request_time = normalize_float_value(options[:request_time])
  @request = options[:request]
  @status = options[:status]
  @body_bytes_sent = normalize_int_value(options[:body_bytes_sent])
  @http_referer = normalize_string_value(options[:http_referer])
  @http_user_agent = normalize_string_value(options[:http_user_agent])
end

Instance Method Details

- (Object) ==(other)



56
57
58
# File 'lib/racknga/log_entry.rb', line 56

def ==(other)
  other.is_a?(self.class) and attributes == other.attributes
end

- (Object) attributes



50
51
52
53
54
# File 'lib/racknga/log_entry.rb', line 50

def attributes
  ATTRIBUTES.collect do |attribute|
    __send__(attribute)
  end
end