Class: Report::BalanceSheet::BalanceSheetCommand
- Inherits:
-
Report::BaseCommand
- Object
- Report::BaseCommand
- Report::BalanceSheet::BalanceSheetCommand
- Defined in:
- app/services/report/balance_sheet/balance_sheet_command.rb
Overview
Command pattern to encapsulate parameters necessary to run a presence report
Constant Summary collapse
- MONTHS_OPTIONS =
Date::MONTHNAMES.compact.each_with_index.map { |name, i| [name, i + 1] }.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#execute ⇒ Object
validates_presence_of :balance_period.
Class Method Details
.company_options ⇒ Object
10 11 12 |
# File 'app/services/report/balance_sheet/balance_sheet_command.rb', line 10 def self. Company. end |
.years ⇒ Object
31 32 33 |
# File 'app/services/report/balance_sheet/balance_sheet_command.rb', line 31 def self.years (2012..Date.current.year).to_a end |
Instance Method Details
#execute ⇒ Object
validates_presence_of :balance_period
16 17 18 19 |
# File 'app/services/report/balance_sheet/balance_sheet_command.rb', line 16 def execute return unless valid? @result = Report::BalanceSheet::BalanceSheet.result_report(attributes) end |