Class: Projects::DailyStatisticsFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/projects/daily_statistics_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ DailyStatisticsFinder

Returns a new instance of DailyStatisticsFinder.



7
8
9
# File 'app/finders/projects/daily_statistics_finder.rb', line 7

def initialize(project)
  @project = project
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



5
6
7
# File 'app/finders/projects/daily_statistics_finder.rb', line 5

def project
  @project
end

Instance Method Details

#fetchesObject



11
12
13
14
15
# File 'app/finders/projects/daily_statistics_finder.rb', line 11

def fetches
  ProjectDailyStatistic.of_project(project)
    .of_last_30_days
    .sorted_by_date_desc
end

#total_fetch_countObject



17
18
19
# File 'app/finders/projects/daily_statistics_finder.rb', line 17

def total_fetch_count
  fetches.sum_fetch_count
end