Class: ProductAnalytics::BuildGraphService

Inherits:
Object
  • Object
show all
Defined in:
app/services/product_analytics/build_graph_service.rb

Direct Known Subclasses

BuildActivityGraphService

Instance Method Summary collapse

Constructor Details

#initialize(project, params) ⇒ BuildGraphService

Returns a new instance of BuildGraphService.



5
6
7
8
# File 'app/services/product_analytics/build_graph_service.rb', line 5

def initialize(project, params)
  @project = project
  @params = params
end

Instance Method Details

#executeObject



10
11
12
13
14
15
16
17
# File 'app/services/product_analytics/build_graph_service.rb', line 10

def execute
  graph = @params[:graph].to_sym
  timerange = @params[:timerange].days

  results = product_analytics_events.count_by_graph(graph, timerange)

  format_results(graph, results)
end