Class: Report::Reconciliation::ReconciliationCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Report::Reconciliation::ReconciliationCommand
- Defined in:
- app/services/report/reconciliation/reconciliation_command.rb
Overview
Command pattern to encapsulate parameters necessary to run a presence report
Class Method Summary collapse
-
.years ⇒ Array<Integer>
Years.
Instance Method Summary collapse
-
#execute ⇒ Object
validates_presence_of :period1_gteq, :period1_lteq.
-
#success? ⇒ Boolean
Whether the command validated and ran successfully.
Class Method Details
.years ⇒ Array<Integer>
Years.
38 39 40 |
# File 'app/services/report/reconciliation/reconciliation_command.rb', line 38 def self.years (2012..Date.current.year).to_a end |
Instance Method Details
#execute ⇒ Object
validates_presence_of :period1_gteq, :period1_lteq
10 11 12 13 14 |
# File 'app/services/report/reconciliation/reconciliation_command.rb', line 10 def execute return unless valid? @result = Report::Reconciliation::Reconciliation.result_report(attributes) end |
#success? ⇒ Boolean
Whether the command validated and ran successfully.
18 19 20 |
# File 'app/services/report/reconciliation/reconciliation_command.rb', line 18 def success? valid? && @result.success? end |