Class: Report::WebSitePerformance::WebSitePerformanceCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
app/services/report/web_site_performance/web_site_performance_command.rb

Overview

Command pattern to encapsulate parameters necessary to run a presence report

Constant Summary collapse

DATA_RANGE_OPTIONS =

Available data range options.

[['Last 7 days', 1], ['This Month', 2], ['Last 30 Days', 3], ['Last Month', 4], ['Last 90 Days', 5], ['This Year', 6], ['Last 365 Days', 7]].freeze
PERIOD_OPTIONS =

Available period options.

[['vs Previous period', 1], ['vs Previous year', 2]].freeze
BREAKDOWN_OPTIONS =

Available breakdown options.

[['Day', 1], ['Week', 2], ['Month', 3]].freeze

Instance Method Summary collapse

Instance Method Details

#executeObject



23
24
25
26
27
# File 'app/services/report/web_site_performance/web_site_performance_command.rb', line 23

def execute
  return unless valid?

  @result = Report::WebSitePerformance::WebSitePerformance.web_site_performance_result(attributes)
end

#success?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'app/services/report/web_site_performance/web_site_performance_command.rb', line 29

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