Class: Orbit::Interceptors::Item
- Inherits:
-
Object
- Object
- Orbit::Interceptors::Item
- Defined in:
- lib/orbit/interceptors/item.rb
Instance Attribute Summary collapse
-
#excludes ⇒ Object
Returns the value of attribute excludes.
-
#interceptor_class ⇒ Object
Returns the value of attribute interceptor_class.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, interceptor_class, excludes = []) ⇒ Item
constructor
A new instance of Item.
- #match_path?(requested_path) ⇒ Boolean
Constructor Details
#initialize(path, interceptor_class, excludes = []) ⇒ Item
Returns a new instance of Item.
6 7 8 9 10 |
# File 'lib/orbit/interceptors/item.rb', line 6 def initialize(path, interceptor_class, excludes=[]) @path = path @interceptor_class = interceptor_class @excludes = excludes end |
Instance Attribute Details
#excludes ⇒ Object
Returns the value of attribute excludes.
4 5 6 |
# File 'lib/orbit/interceptors/item.rb', line 4 def excludes @excludes end |
#interceptor_class ⇒ Object
Returns the value of attribute interceptor_class.
4 5 6 |
# File 'lib/orbit/interceptors/item.rb', line 4 def interceptor_class @interceptor_class end |
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/orbit/interceptors/item.rb', line 4 def path @path end |
Instance Method Details
#match_path?(requested_path) ⇒ Boolean
12 13 14 |
# File 'lib/orbit/interceptors/item.rb', line 12 def match_path?(requested_path) requested_path.match("^#{path}") && !excludes.include?(requested_path) end |