Class: Racknga::LogEntry
- Inherits:
-
Object
- Object
- Racknga::LogEntry
- Defined in:
- lib/racknga/log_entry.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.
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/racknga/log_entry.rb', line 36 def initialize(=nil) ||= {} @remote_address = [:remote_address] @remote_user = normalize_string_value([:remote_user]) @time_local = [:time_local] || Time.at(0) @runtime = normalize_float_value([:runtime]) @request_time = normalize_float_value([:request_time]) @request = [:request] @status = [:status] @body_bytes_sent = normalize_int_value([:body_bytes_sent]) @http_referer = normalize_string_value([:http_referer]) @http_user_agent = normalize_string_value([:http_user_agent]) end |
Instance Method Details
#==(other) ⇒ Object
56 57 58 |
# File 'lib/racknga/log_entry.rb', line 56 def ==(other) other.is_a?(self.class) and attributes == other.attributes end |
#attributes ⇒ Object
50 51 52 53 54 |
# File 'lib/racknga/log_entry.rb', line 50 def attributes ATTRIBUTES.collect do |attribute| __send__(attribute) end end |