Class: Trackguard::Adapters::Base
- Inherits:
-
Object
- Object
- Trackguard::Adapters::Base
- Defined in:
- lib/trackguard/adapters/base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #blocked_path?(path) ⇒ Boolean
- #blocked_user_agent?(user_agent) ⇒ Boolean
- #flagged_visitor?(ip) ⇒ Boolean
- #track_blocked_request(ip:, user_agent:, path:, http_method:, block_reason:) ⇒ Object
- #track_page_view(path:, ip:, user_agent:, referer:, session_id:, trace_id:, source:, initial:, http_method:) ⇒ Object
- #whitelisted_ip?(ip) ⇒ Boolean
Instance Method Details
#blocked_path?(path) ⇒ Boolean
7 |
# File 'lib/trackguard/adapters/base.rb', line 7 def blocked_path?(path) = raise NotImplementedError, "#{self.class}#blocked_path?" |
#blocked_user_agent?(user_agent) ⇒ Boolean
6 |
# File 'lib/trackguard/adapters/base.rb', line 6 def blocked_user_agent?(user_agent) = raise NotImplementedError, "#{self.class}#blocked_user_agent?" |
#flagged_visitor?(ip) ⇒ Boolean
9 |
# File 'lib/trackguard/adapters/base.rb', line 9 def flagged_visitor?(ip) = raise NotImplementedError, "#{self.class}#flagged_visitor?" |
#track_blocked_request(ip:, user_agent:, path:, http_method:, block_reason:) ⇒ Object
23 24 25 |
# File 'lib/trackguard/adapters/base.rb', line 23 def track_blocked_request(ip:, user_agent:, path:, http_method:, block_reason:) raise NotImplementedError, "#{self.class}#track_blocked_request" end |
#track_page_view(path:, ip:, user_agent:, referer:, session_id:, trace_id:, source:, initial:, http_method:) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/trackguard/adapters/base.rb', line 11 def track_page_view(path:, ip:, user_agent:, referer:, session_id:, trace_id:, source:, initial:, http_method:) return if blocked_user_agent?(user_agent) return if blocked_path?(path) return if path.blank? || path.start_with?(Trackguard.admin_path) perform_track_page_view( path: path, ip: ip, user_agent: user_agent, referer: referer, session_id: session_id, trace_id: trace_id, source: source, initial: initial, http_method: http_method ) end |
#whitelisted_ip?(ip) ⇒ Boolean
8 |
# File 'lib/trackguard/adapters/base.rb', line 8 def whitelisted_ip?(ip) = raise NotImplementedError, "#{self.class}#whitelisted_ip?" |