Class: T1000::Middleware

Inherits:
Rack::Attack
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/t-1000/middleware.rb

Instance Method Summary collapse

Instance Method Details

#cacheObject



10
11
12
# File 'lib/t-1000/middleware.rb', line 10

def cache
  T1000.cache
end

#call(env) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/t-1000/middleware.rb', line 14

def call(env)
  req          = Request.new(env)
  transactions = TransactionList.for_ip(req.ip)
  super.tap do |status, headers, *|
    transaction = Transaction.new req, Response.new(status, headers)
    transactions.push transaction
  end
end