Class: LHC::Interceptor
- Inherits:
-
Object
show all
- Defined in:
- lib/lhc/interceptor.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
-
.dup ⇒ Object
Prevent Interceptors from beeing duplicated! Their classes have flag-character.
Instance Method Summary
collapse
Constructor Details
#initialize(request) ⇒ Interceptor
Returns a new instance of Interceptor.
7
8
9
|
# File 'lib/lhc/interceptor.rb', line 7
def initialize(request)
@request = request
end
|
Instance Attribute Details
#request ⇒ Object
Returns the value of attribute request.
5
6
7
|
# File 'lib/lhc/interceptor.rb', line 5
def request
@request
end
|
Class Method Details
.dup ⇒ Object
Prevent Interceptors from beeing duplicated! Their classes have flag-character. When duplicated you can’t check for their class name anymore: e.g. options.deep_dup.include?(LHC::Caching) # false
29
30
31
|
# File 'lib/lhc/interceptor.rb', line 29
def self.dup
self
end
|
Instance Method Details
#after_request ⇒ Object
19
|
# File 'lib/lhc/interceptor.rb', line 19
def after_request; end
|
#after_response ⇒ Object
23
|
# File 'lib/lhc/interceptor.rb', line 23
def after_response; end
|
#all_interceptor_classes ⇒ Object
33
34
35
|
# File 'lib/lhc/interceptor.rb', line 33
def all_interceptor_classes
@all_interceptors ||= LHC::Interceptors.new(request).all.map(&:class)
end
|
#before_raw_request ⇒ Object
15
|
# File 'lib/lhc/interceptor.rb', line 15
def before_raw_request; end
|
#before_request ⇒ Object
17
|
# File 'lib/lhc/interceptor.rb', line 17
def before_request; end
|
#before_response ⇒ Object
21
|
# File 'lib/lhc/interceptor.rb', line 21
def before_response; end
|
#response ⇒ Object
11
12
13
|
# File 'lib/lhc/interceptor.rb', line 11
def response
@request.response
end
|