Class: Report::CampaignsReport::CampaignsReportCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
app/services/report/campaigns_report/campaigns_report_command.rb

Overview

Service object: campaigns report command.

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/campaigns_report/campaigns_report_command.rb', line 12

def execute
  return unless valid?

  @result = Report::CampaignsReport::CampaignsReport.result(attributes)
end

#success?Boolean

Whether the command validated and ran successfully.

Returns:

  • (Boolean)


20
21
22
# File 'app/services/report/campaigns_report/campaigns_report_command.rb', line 20

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