Class: Racknga::LogEntry
- Inherits:
-
Object
- Object
- Racknga::LogEntry
- Defined in:
- lib/racknga/nginx_access_log_parser.rb
Constant Summary collapse
- ATTRIBUTES =
[ :remote_address, :remote_user, :time_local, :runtime, :request_time, :request, :status, :body_bytes_sent, :http_referer, :http_user_agent, ]
Instance Method Summary collapse
- #==(other) ⇒ Object
- #attributes ⇒ Object
-
#initialize(options = nil) ⇒ LogEntry
constructor
A new instance of LogEntry.
Constructor Details
#initialize(options = nil) ⇒ LogEntry
Returns a new instance of LogEntry.
115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/racknga/nginx_access_log_parser.rb', line 115 def initialize(=nil) ||= {} @remote_address = [:remote_address] @remote_user = [:remote_user] @time_local = [:time_local] || Time.at(0) @runtime = [:runtime] || 0.0 @request_time = [:request_time] || 0.0 @request = [:request] @status = [:status] @body_bytes_sent = [:body_bytes_sent] @http_referer = [:http_referer] @http_user_agent = [:http_user_agent] end |
Instance Method Details
#==(other) ⇒ Object
135 136 137 |
# File 'lib/racknga/nginx_access_log_parser.rb', line 135 def ==(other) attributes == other.attributes end |
#attributes ⇒ Object
129 130 131 132 133 |
# File 'lib/racknga/nginx_access_log_parser.rb', line 129 def attributes ATTRIBUTES.collect do |attribute| __send__(attribute) end end |