Class: Report::TechCallsReport::TechCallsReportCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
app/services/report/tech_calls_report/tech_calls_report_command.rb

Overview

Command pattern to encapsulate parameters necessary to run a presence report

Instance Method Summary collapse

Instance Method Details

#executeObject

Run the report with the given filters and store the result.

Returns:

  • (Object)


11
12
13
14
15
# File 'app/services/report/tech_calls_report/tech_calls_report_command.rb', line 11

def execute
  return unless valid?

  @result = Report::TechCallsReport::TechCallsReport.total_report(attributes)
end

#success?Boolean

Whether the command validated and ran successfully.

Returns:

  • (Boolean)


19
20
21
# File 'app/services/report/tech_calls_report/tech_calls_report_command.rb', line 19

def success?
  valid? && @result.success?
end