Class: Orbit::Interceptors::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/orbit/interceptors/item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#excludesObject

Returns the value of attribute excludes.



4
5
6
# File 'lib/orbit/interceptors/item.rb', line 4

def excludes
  @excludes
end

#interceptor_classObject

Returns the value of attribute interceptor_class.



4
5
6
# File 'lib/orbit/interceptors/item.rb', line 4

def interceptor_class
  @interceptor_class
end

#pathObject

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

Returns:

  • (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