Class: Report::SourcesReport::SourcesReportCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
app/services/report/sources_report/sources_report_command.rb

Constant Summary collapse

BASELINE_PERIOD_OPTIONS =
[["current month", 1], ["current quarter", 2], ["current year", 3], ["last month", 4], ["last quarter", 5], ["last 3 months", 6], ["last 12 months", 7]]
COMPARISON_PERIOD_OPTIONS =
[["compare to previous period this year", 1], ["compare to last year same period", 2]]

Instance Method Summary collapse

Instance Method Details

#executeObject



15
16
17
18
19
# File 'app/services/report/sources_report/sources_report_command.rb', line 15

def execute
  return unless valid?
  check_for_warnings
  @result = Report::SourcesReport::SourcesReport.result_report(attributes)
end

#success?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/services/report/sources_report/sources_report_command.rb', line 21

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