gitlab-org--gitlab-foss/app/services/search/snippet_service.rb

16 lines
323 B
Ruby
Raw Normal View History

module Search
class SnippetService
attr_accessor :current_user, :params
def initialize(user, params)
@current_user, @params = user, params.dup
end
def execute
snippets = Snippet.accessible_to(current_user)
Gitlab::SnippetSearchResults.new(snippets, params[:search])
end
end
end