Class: Report::ProfileDiscount::ProfileDiscountCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Report::ProfileDiscount::ProfileDiscountCommand
- Defined in:
- app/services/report/profile_discount/profile_discount_command.rb
Overview
Command pattern to encapsulate parameters necessary to run a presence report
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.
Instance Method Details
#execute ⇒ Object
Run the report with the given filters and store the result.
8 9 10 11 12 |
# File 'app/services/report/profile_discount/profile_discount_command.rb', line 8 def execute return unless valid? @result = Report::ProfileDiscount::ProfileDiscount.result_report(attributes) end |
#success? ⇒ Boolean
Whether the command validated and ran successfully.
16 17 18 |
# File 'app/services/report/profile_discount/profile_discount_command.rb', line 16 def success? valid? && @result.success? end |