Class: Projects::FetchStatisticsIncrementService

Inherits:
Object
  • Object
show all
Defined in:
app/services/projects/fetch_statistics_increment_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ FetchStatisticsIncrementService

Returns a new instance of FetchStatisticsIncrementService.



7
8
9
# File 'app/services/projects/fetch_statistics_increment_service.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/services/projects/fetch_statistics_increment_service.rb', line 5

def project
  @project
end

Instance Method Details

#executeObject



11
12
13
14
15
# File 'app/services/projects/fetch_statistics_increment_service.rb', line 11

def execute
  ProjectDailyStatistic
  .find_or_create_project_daily_statistic(project.id, Date.today)
  .increment_fetch_count(1)
end