Class: Report::BookOfBusiness::BookOfBusinessCommand
- Inherits:
-
Report::BaseCommand
- Object
- Report::BaseCommand
- Report::BookOfBusiness::BookOfBusinessCommand
- Defined in:
- app/services/report/book_of_business/book_of_business_command.rb
Overview
Command pattern to encapsulate parameters necessary to run a presence report
Class Method Summary collapse
-
.company_options ⇒ Object
Company options.
Instance Method Summary collapse
-
#execute ⇒ Object
Run the report with the given filters and store the result.
-
#success? ⇒ Boolean
Whether the command validated and ran successfully.
Class Method Details
.company_options ⇒ Object
Company options.
15 16 17 |
# File 'app/services/report/book_of_business/book_of_business_command.rb', line 15 def self. @company_options ||= Company. end |
Instance Method Details
#execute ⇒ Object
Run the report with the given filters and store the result.
21 22 23 24 25 |
# File 'app/services/report/book_of_business/book_of_business_command.rb', line 21 def execute return unless valid? @result = Report::BookOfBusiness::BookOfBusiness.result_report(attributes) end |
#success? ⇒ Boolean
Whether the command validated and ran successfully.
29 30 31 |
# File 'app/services/report/book_of_business/book_of_business_command.rb', line 29 def success? valid? && @result.success? end |