Class: Report::CostCenter::CostCenterCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
app/services/report/cost_center/cost_center_command.rb

Overview

Command pattern to encapsulate parameters necessary to run a presence report

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.yearsObject



23
24
25
# File 'app/services/report/cost_center/cost_center_command.rb', line 23

def self.years
  (2012..Date.current.year).to_a
end

Instance Method Details

#executeObject



8
9
10
11
# File 'app/services/report/cost_center/cost_center_command.rb', line 8

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