Class: Gitlab::SnippetSearchResults
- Inherits:
-
SearchResults
- Object
- SearchResults
- Gitlab::SnippetSearchResults
- Includes:
- SnippetsHelper
- Defined in:
- lib/gitlab/snippet_search_results.rb
Constant Summary
Constants inherited from SearchResults
Gitlab::SearchResults::COUNT_LIMIT, Gitlab::SearchResults::COUNT_LIMIT_MESSAGE, Gitlab::SearchResults::DEFAULT_PAGE, Gitlab::SearchResults::DEFAULT_PER_PAGE
Instance Attribute Summary collapse
-
#organization_id ⇒ Object
readonly
Returns the value of attribute organization_id.
Attributes inherited from SearchResults
#current_user, #default_project_filter, #filters, #limit_projects, #order_by, #query, #sort
Instance Method Summary collapse
- #formatted_count(scope) ⇒ Object
-
#initialize(current_user, query, organization_id: nil) ⇒ SnippetSearchResults
constructor
A new instance of SnippetSearchResults.
- #limited_snippet_titles_count ⇒ Object
- #objects(scope, page: nil, per_page: DEFAULT_PER_PAGE, preload_method: nil) ⇒ Object
Methods included from SnippetsHelper
#embedded_copy_snippet_button, #embedded_raw_snippet_button, #embedded_snippet_download_button, #project_snippets_award_api_path, #snippet_badge, #snippet_badge_attributes, #snippet_file_count, #snippet_report_abuse_path, #snippets_upload_path, #subject_snippets_path
Methods inherited from SearchResults
#aggregations, #count_limit, #counts, #error, #failed?, #formatted_limited_count, #highlight_map, #limited_issues_count, #limited_merge_requests_count, #limited_milestones_count, #limited_projects_count, #limited_users_count, #users
Constructor Details
#initialize(current_user, query, organization_id: nil) ⇒ SnippetSearchResults
Returns a new instance of SnippetSearchResults.
9 10 11 12 |
# File 'lib/gitlab/snippet_search_results.rb', line 9 def initialize(current_user, query, organization_id: nil) @organization_id = organization_id super(current_user, query) end |
Instance Attribute Details
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
7 8 9 |
# File 'lib/gitlab/snippet_search_results.rb', line 7 def organization_id @organization_id end |
Instance Method Details
#formatted_count(scope) ⇒ Object
18 19 20 |
# File 'lib/gitlab/snippet_search_results.rb', line 18 def formatted_count(scope) formatted_limited_count(limited_snippet_titles_count) end |
#limited_snippet_titles_count ⇒ Object
22 23 24 |
# File 'lib/gitlab/snippet_search_results.rb', line 22 def limited_snippet_titles_count @limited_snippet_titles_count ||= limited_count(snippet_titles) end |
#objects(scope, page: nil, per_page: DEFAULT_PER_PAGE, preload_method: nil) ⇒ Object
14 15 16 |
# File 'lib/gitlab/snippet_search_results.rb', line 14 def objects(scope, page: nil, per_page: DEFAULT_PER_PAGE, preload_method: nil) paginated_objects(snippet_titles, page, per_page) end |