Class: Report::ConversionReport::ConversionReportCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
app/services/report/conversion_report/conversion_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)


12
13
14
15
16
# File 'app/services/report/conversion_report/conversion_report_command.rb', line 12

def execute
  return unless valid?

  @result = Report::ConversionReport::ConversionReport.opportunity_report(attributes)
end

#success?Boolean

Whether the command validated and ran successfully.

Returns:

  • (Boolean)


20
21
22
# File 'app/services/report/conversion_report/conversion_report_command.rb', line 20

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