Class: Report::OpportunitiesReport::OpportunitiesReportCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
app/services/report/opportunities_report/opportunities_report_command.rb

Overview

Command pattern to encapsulate parameters necessary to run a presence report

Constant Summary collapse

PERIOD_OPTIONS =
[["Daily","daily"],["3 months ago","3 month"],["6 months ago","6 month"],["9 months ago","9 month"]]
AMOUNT_OPTIONS =
[[">= $2,000",2000],[">= $5,000",5000],[">= $10,000",10000]]

Instance Method Summary collapse

Instance Method Details

#executeObject



14
15
16
17
# File 'app/services/report/opportunities_report/opportunities_report_command.rb', line 14

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

#success?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/services/report/opportunities_report/opportunities_report_command.rb', line 19

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