Class: Report::ProfileDiscount::ProfileDiscountCommand

Inherits:
BaseCommand
  • Object
show all
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

Instance Method Details

#executeObject



6
7
8
9
# File 'app/services/report/profile_discount/profile_discount_command.rb', line 6

def execute
  return unless valid?
  @result = Report::ProfileDiscount::ProfileDiscount.result_report(attributes)
end

#success?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'app/services/report/profile_discount/profile_discount_command.rb', line 11

def success?
  valid? && @result.success?
end