Class: Trackguard::Adapters::Local
- Defined in:
- lib/trackguard/adapters/local.rb
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
- #whitelisted_ip?(ip) ⇒ Boolean
Methods inherited from Base
Instance Method Details
#blocked_path?(path) ⇒ Boolean
10 11 12 |
# File 'lib/trackguard/adapters/local.rb', line 10 def blocked_path?(path) BlockedPath.blocked?(path) end |
#blocked_user_agent?(user_agent) ⇒ Boolean
6 7 8 |
# File 'lib/trackguard/adapters/local.rb', line 6 def blocked_user_agent?(user_agent) BlockedUserAgent.blocked?(user_agent) end |
#flagged_visitor?(ip) ⇒ Boolean
18 19 20 |
# File 'lib/trackguard/adapters/local.rb', line 18 def flagged_visitor?(ip) Visitor.flagged?(ip) end |
#track_blocked_request(ip:, user_agent:, path:, http_method:, block_reason:) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/trackguard/adapters/local.rb', line 22 def track_blocked_request(ip:, user_agent:, path:, http_method:, block_reason:) TrackBlockedRequestJob.perform_later( ip: ip, user_agent: user_agent, path: path, http_method: http_method, block_reason: block_reason ) end |
#whitelisted_ip?(ip) ⇒ Boolean
14 15 16 |
# File 'lib/trackguard/adapters/local.rb', line 14 def whitelisted_ip?(ip) WhitelistedIp.whitelisted?(ip) end |