Class: Report::AccountingRecords::AccountingRecordsCommand

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


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

def execute
  return unless valid?

  @result = Report::AccountingRecords::AccountingRecords.result_report(attributes)
end

#success?Boolean

Whether the command validated and ran successfully.

Returns:

  • (Boolean)


23
24
25
# File 'app/services/report/accounting_records/accounting_records_command.rb', line 23

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