Class: Search::ProjectService

Inherits:
Object
  • Object
show all
Defined in:
app/services/search/project_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project, user, params) ⇒ ProjectService

Returns a new instance of ProjectService


5
6
7
# File 'app/services/search/project_service.rb', line 5

def initialize(project, user, params)
  @project, @current_user, @params = project, user, params.dup
end

Instance Attribute Details

#current_userObject

Returns the value of attribute current_user


3
4
5
# File 'app/services/search/project_service.rb', line 3

def current_user
  @current_user
end

#paramsObject

Returns the value of attribute params


3
4
5
# File 'app/services/search/project_service.rb', line 3

def params
  @params
end

#projectObject

Returns the value of attribute project


3
4
5
# File 'app/services/search/project_service.rb', line 3

def project
  @project
end

Instance Method Details

#executeObject


9
10
11
12
13
14
# File 'app/services/search/project_service.rb', line 9

def execute
  Gitlab::ProjectSearchResults.new(current_user,
                                   project,
                                   params[:search],
                                   params[:repository_ref])
end