Class: DHC::Interceptor
- Inherits:
-
Object
show all
- Defined in:
- lib/dhc/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/dhc/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/dhc/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?(DHC::Caching) # false
29
30
31
|
# File 'lib/dhc/interceptor.rb', line 29
def self.dup
self
end
|
Instance Method Details
#after_request ⇒ Object
19
|
# File 'lib/dhc/interceptor.rb', line 19
def after_request; end
|
#after_response ⇒ Object
23
|
# File 'lib/dhc/interceptor.rb', line 23
def after_response; end
|
#all_interceptor_classes ⇒ Object
33
34
35
|
# File 'lib/dhc/interceptor.rb', line 33
def all_interceptor_classes
@all_interceptors ||= DHC::Interceptors.new(request).all.map(&:class)
end
|
#before_init ⇒ Object
15
|
# File 'lib/dhc/interceptor.rb', line 15
def before_init; end
|
#before_request ⇒ Object
17
|
# File 'lib/dhc/interceptor.rb', line 17
def before_request; end
|
#before_response ⇒ Object
21
|
# File 'lib/dhc/interceptor.rb', line 21
def before_response; end
|
#response ⇒ Object
11
12
13
|
# File 'lib/dhc/interceptor.rb', line 11
def response
@request.response
end
|