Class: Modern::App::RequestHandling::PartialRequestContainer

Inherits:
Object
  • Object
show all
Defined in:
lib/modern/app/request_handling/request_container.rb

Overview

Encapsulates all non-derived portions of the request to run security actions inside of it.

Direct Known Subclasses

FullRequestContainer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger, configuration, services, route, request, response) ⇒ PartialRequestContainer

Returns a new instance of PartialRequestContainer.



17
18
19
20
21
22
23
24
25
# File 'lib/modern/app/request_handling/request_container.rb', line 17

def initialize(logger, configuration, services, route, request, response)
  @logger = logger
  @configuration = configuration
  @services = services
  @route = route

  @request = request
  @response = response
end

Instance Attribute Details

#configurationObject (readonly)

Returns the value of attribute configuration.



10
11
12
# File 'lib/modern/app/request_handling/request_container.rb', line 10

def configuration
  @configuration
end

#loggerObject (readonly)

Returns the value of attribute logger.



9
10
11
# File 'lib/modern/app/request_handling/request_container.rb', line 9

def logger
  @logger
end

#requestObject (readonly)

Returns the value of attribute request.



14
15
16
# File 'lib/modern/app/request_handling/request_container.rb', line 14

def request
  @request
end

#responseObject (readonly)

Returns the value of attribute response.



15
16
17
# File 'lib/modern/app/request_handling/request_container.rb', line 15

def response
  @response
end

#routeObject (readonly)

Returns the value of attribute route.



12
13
14
# File 'lib/modern/app/request_handling/request_container.rb', line 12

def route
  @route
end

#servicesObject (readonly)

Returns the value of attribute services.



11
12
13
# File 'lib/modern/app/request_handling/request_container.rb', line 11

def services
  @services
end

Instance Method Details

#with_logger_fields(fields = {}) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/modern/app/request_handling/request_container.rb', line 27

def with_logger_fields(fields = {})
  original_logger = @logger
  @logger = original_logger.child(fields)

  ret = yield

  @logger = original_logger

  ret
end