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
Instance Method Summary collapse
-
#execute ⇒ Object
validates_presence_of :balance_period.
Class Method Details
.years ⇒ Object
29 30 31 |
# File 'app/services/report/profit_loss/profit_loss_command.rb', line 29 def self.years (2012..Date.current.year).to_a end |
Instance Method Details
#execute ⇒ Object
validates_presence_of :balance_period
13 14 15 16 17 |
# File 'app/services/report/profit_loss/profit_loss_command.rb', line 13 def execute return unless valid? @result = Report::ProfitLoss::ProfitLoss.result_report(attributes) end |