Class: Report::SourcesReport::SourcesReportCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Report::SourcesReport::SourcesReportCommand
- Defined in:
- app/services/report/sources_report/sources_report_command.rb
Overview
Service object: sources report command.
Constant Summary collapse
- BASELINE_PERIOD_OPTIONS =
Available 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]].freeze
- COMPARISON_PERIOD_OPTIONS =
Available comparison period options.
[["compare to previous period this year", 1], ["compare to last year same period", 2]].freeze
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
18 19 20 21 22 23 |
# File 'app/services/report/sources_report/sources_report_command.rb', line 18 def execute return unless valid? check_for_warnings @result = Report::SourcesReport::SourcesReport.result_report(attributes) end |
#success? ⇒ Boolean
25 26 27 |
# File 'app/services/report/sources_report/sources_report_command.rb', line 25 def success? valid? && @result.success? end |