Class: Rack::Congestion::Request

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rack/congestion/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env, key, options = { }) ⇒ Request

Returns a new instance of Request.



18
19
20
21
22
# File 'lib/rack/congestion/request.rb', line 18

def initialize(env, key, options = { })
  self.env = env
  self.key = key
  self.options = options
end

Instance Attribute Details

#envObject

Returns the value of attribute env.



7
8
9
# File 'lib/rack/congestion/request.rb', line 7

def env
  @env
end

#keyObject

Returns the value of attribute key.



7
8
9
# File 'lib/rack/congestion/request.rb', line 7

def key
  @key
end

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/rack/congestion/request.rb', line 7

def options
  @options
end

Instance Method Details

#congestionObject



28
29
30
# File 'lib/rack/congestion/request.rb', line 28

def congestion
  @congestion ||= ::Congestion.request key.call, options
end

#rack_requestObject



24
25
26
# File 'lib/rack/congestion/request.rb', line 24

def rack_request
  @rack_request ||= Rack::Request.new env
end