Class: Packages::Nuget::SearchService
- Inherits:
-
BaseService
- Object
- BaseService
- Packages::Nuget::SearchService
- Includes:
- ActiveRecord::ConnectionAdapters::Quoting, Gitlab::Utils::StrongMemoize, FinderHelper
- Defined in:
- app/services/packages/nuget/search_service.rb
Defined Under Namespace
Classes: Result
Constant Summary collapse
- MAX_PER_PAGE =
30
- MAX_VERSIONS_PER_PACKAGE =
10
- PRE_RELEASE_VERSION_MATCHING_TERM =
'%-%'
- DEFAULT_OPTIONS =
{ include_prerelease_versions: true, per_page: Kaminari.config.default_per_page, padding: 0 }.freeze
Constants included from FinderHelper
FinderHelper::InvalidPackageTypeError, FinderHelper::InvalidStatusError
Instance Attribute Summary
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(current_user, project_or_group, search_term, options = {}) ⇒ SearchService
constructor
A new instance of SearchService.
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
#initialize(current_user, project_or_group, search_term, options = {}) ⇒ SearchService
Returns a new instance of SearchService.
20 21 22 23 24 25 26 27 28 |
# File 'app/services/packages/nuget/search_service.rb', line 20 def initialize(current_user, project_or_group, search_term, = {}) @current_user = current_user @project_or_group = project_or_group @search_term = search_term @options = DEFAULT_OPTIONS.merge() raise ArgumentError, 'negative per_page' if per_page < 0 raise ArgumentError, 'negative padding' if padding < 0 end |