Module: Lupa::ScopeMethods Private
- Defined in:
- lib/lupa/scope_methods.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
This module is included automatically by Lupa and should not be included manually in your code.
Internal module that provides common functionality to Scope classes. This module is automatically included in the Scope class defined within your search class.
It provides access to two key attributes:
-
‘scope`: The current scope being searched
-
‘search_attributes`: The hash of search parameters
Instance Attribute Summary collapse
-
#scope ⇒ Object
The current scope object that search methods will operate on.
- #search_attributes ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(scope, search_attributes) ⇒ ScopeMethods
private
Initializes a new Scope instance with the given scope and search attributes.
Instance Attribute Details
#scope ⇒ Object
The current scope object that search methods will operate on. This is typically an ActiveRecord::Relation or similar chainable object. The scope is updated after each search method is called.
48 49 50 |
# File 'lib/lupa/scope_methods.rb', line 48 def scope @scope end |
#search_attributes ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
68 69 70 |
# File 'lib/lupa/scope_methods.rb', line 68 def search_attributes @search_attributes end |
Instance Method Details
#initialize(scope, search_attributes) ⇒ ScopeMethods
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes a new Scope instance with the given scope and search attributes. This method is called automatically by Lupa::Search and should not be called directly.
85 86 87 88 |
# File 'lib/lupa/scope_methods.rb', line 85 def initialize(scope, search_attributes) @scope = scope @search_attributes = search_attributes end |