Class: Report::MissedCalls::MissedCallsCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Report::MissedCalls::MissedCallsCommand
- Defined in:
- app/services/report/missed_calls/missed_calls_command.rb
Overview
Command pattern to encapsulate parameters necessary to run a presence report
Instance Attribute Summary collapse
- #result_type_filter ⇒ Object readonly
Instance Method Summary collapse
Instance Attribute Details
#result_type_filter ⇒ Object (readonly)
9 |
# File 'app/services/report/missed_calls/missed_calls_command.rb', line 9 validates :result_type_filter, inclusion: { in: %w[both completed not_completed] } |
Instance Method Details
#execute ⇒ Object
11 12 13 14 |
# File 'app/services/report/missed_calls/missed_calls_command.rb', line 11 def execute return unless valid? @result = Report::MissedCalls::MissedCalls.result_report(attributes) end |
#success? ⇒ Boolean
20 21 22 |
# File 'app/services/report/missed_calls/missed_calls_command.rb', line 20 def success? valid? && @result.success? end |
#unfiltered_data ⇒ Object
16 17 18 |
# File 'app/services/report/missed_calls/missed_calls_command.rb', line 16 def unfiltered_data Report::MissedCalls::MissedCalls.result_report(attributes.merge(result_type_filter: 'both')).data end |