Class: Report::BookOfBusiness::BookOfBusinessCommand

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

Instance Method Summary collapse

Class Method Details

.company_optionsObject



13
14
15
# File 'app/services/report/book_of_business/book_of_business_command.rb', line 13

def self.company_options
  @company_options ||= Company.select_options_sales_companies
end

Instance Method Details

#executeObject



17
18
19
20
# File 'app/services/report/book_of_business/book_of_business_command.rb', line 17

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

#success?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'app/services/report/book_of_business/book_of_business_command.rb', line 22

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