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 =
Available months options.
Date::MONTHNAMES.compact.each_with_index.map { |name, i| [name, i + 1] }.freeze
Class Method Summary collapse
-
.company_options ⇒ Object
Company options.
-
.years ⇒ Array<Integer>
Years.
Instance Method Summary collapse
-
#execute ⇒ Object
validates_presence_of :balance_period.
Class Method Details
.company_options ⇒ Object
Company options.
13 14 15 |
# File 'app/services/report/balance_sheet/balance_sheet_command.rb', line 13 def self. Company. end |
.years ⇒ Array<Integer>
Years.
40 41 42 |
# File 'app/services/report/balance_sheet/balance_sheet_command.rb', line 40 def self.years (2012..Date.current.year).to_a end |
Instance Method Details
#execute ⇒ Object
validates_presence_of :balance_period
18 19 20 21 22 |
# File 'app/services/report/balance_sheet/balance_sheet_command.rb', line 18 def execute return unless valid? @result = Report::BalanceSheet::BalanceSheet.result_report(attributes) end |