Class: RedisAnalytics::PathFilter
- Inherits:
-
Object
- Object
- RedisAnalytics::PathFilter
- Defined in:
- lib/redis_analytics/filter.rb
Instance Attribute Summary collapse
-
#filter_path ⇒ Object
readonly
Returns the value of attribute filter_path.
Instance Method Summary collapse
-
#initialize(filter_path) ⇒ PathFilter
constructor
A new instance of PathFilter.
- #matches?(request_path) ⇒ Boolean
Constructor Details
#initialize(filter_path) ⇒ PathFilter
Returns a new instance of PathFilter.
18 19 20 |
# File 'lib/redis_analytics/filter.rb', line 18 def initialize(filter_path) @filter_path = filter_path end |
Instance Attribute Details
#filter_path ⇒ Object (readonly)
Returns the value of attribute filter_path.
16 17 18 |
# File 'lib/redis_analytics/filter.rb', line 16 def filter_path @filter_path end |
Instance Method Details
#matches?(request_path) ⇒ Boolean
22 23 24 25 26 27 28 |
# File 'lib/redis_analytics/filter.rb', line 22 def matches?(request_path) if filter_path.is_a?(String) request_path == filter_path elsif filter_path.is_a?(Regexp) request_path =~ filter_path end end |