Class: WebHooks::WebHookLogsFinder
- Inherits:
-
Object
- Object
- WebHooks::WebHookLogsFinder
- Defined in:
- app/finders/web_hooks/web_hook_logs_finder.rb
Instance Attribute Summary collapse
-
#current_user ⇒ Object
Returns the value of attribute current_user.
-
#hook ⇒ Object
Returns the value of attribute hook.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(hook, current_user, params = {}) ⇒ WebHookLogsFinder
constructor
A new instance of WebHookLogsFinder.
Constructor Details
#initialize(hook, current_user, params = {}) ⇒ WebHookLogsFinder
Returns a new instance of WebHookLogsFinder.
7 8 9 10 11 |
# File 'app/finders/web_hooks/web_hook_logs_finder.rb', line 7 def initialize(hook, current_user, params = {}) @hook = hook @current_user = current_user @params = params end |
Instance Attribute Details
#current_user ⇒ Object
Returns the value of attribute current_user.
5 6 7 |
# File 'app/finders/web_hooks/web_hook_logs_finder.rb', line 5 def current_user @current_user end |
#hook ⇒ Object
Returns the value of attribute hook.
5 6 7 |
# File 'app/finders/web_hooks/web_hook_logs_finder.rb', line 5 def hook @hook end |
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'app/finders/web_hooks/web_hook_logs_finder.rb', line 5 def params @params end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'app/finders/web_hooks/web_hook_logs_finder.rb', line 13 def execute return WebHookLog.none unless logs = hook.web_hook_logs logs = by_status_code(logs) logs = by_created_at(logs) by_id(logs) end |