Class: Report::ProfitLoss::ProfitLossCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Report::ProfitLoss::ProfitLossCommand
- Defined in:
- app/services/report/profit_loss/profit_loss_command.rb
Overview
Command pattern to encapsulate parameters necessary to run a presence report
Constant Summary collapse
- MONTHS_OPTIONS =
Available months options.
[['January', 1], ['February', 2], ['March', 3], ['April', 4], ['May', 5], ['June', 6], ['July', 7], ['August', 8], ['September', 9], ['October', 10], ['November', 11], ['December', 12]].freeze
Class Method Summary collapse
-
.years ⇒ Array<Integer>
Years.
Instance Method Summary collapse
-
#execute ⇒ Object
validates_presence_of :balance_period.
Class Method Details
.years ⇒ Array<Integer>
Years.
34 35 36 |
# File 'app/services/report/profit_loss/profit_loss_command.rb', line 34 def self.years (2012..Date.current.year).to_a end |
Instance Method Details
#execute ⇒ Object
validates_presence_of :balance_period
12 13 14 15 16 |
# File 'app/services/report/profit_loss/profit_loss_command.rb', line 12 def execute return unless valid? @result = Report::ProfitLoss::ProfitLoss.result_report(attributes) end |