class RequestLogAnalyzer::Database::Request

Public Class Methods

create_table!() click to toggle source

Creates the table to store requests in.

   # File lib/request_log_analyzer/database/request.rb
12 def self.create_table!
13   unless database.connection.table_exists?(:requests)
14     database.connection.create_table(:requests) do |t|
15       t.column :first_lineno, :integer
16       t.column :last_lineno,  :integer
17     end
18   end
19 end

Public Instance Methods

lines() click to toggle source

Returns an array of all the Line objects of this request in the correct order.

  # File lib/request_log_analyzer/database/request.rb
3 def lines
4   @lines ||= begin
5     lines = []
6     self.class.reflections.each { |r, _d| lines += send(r).all }
7     lines.sort
8   end
9 end