Class: PgSearch::Scope
- Inherits:
-
Object
- Object
- PgSearch::Scope
- Defined in:
- lib/pg_search/scope.rb
Instance Method Summary collapse
-
#initialize(name, model, scope_options_or_proc) ⇒ Scope
constructor
A new instance of Scope.
- #to_proc ⇒ Object
Constructor Details
#initialize(name, model, scope_options_or_proc) ⇒ Scope
Returns a new instance of Scope.
3 4 5 6 7 |
# File 'lib/pg_search/scope.rb', line 3 def initialize(name, model, ) @name = name @model = model @options_proc = () end |
Instance Method Details
#to_proc ⇒ Object
9 10 11 12 13 14 |
# File 'lib/pg_search/scope.rb', line 9 def to_proc lambda { |*args| config = Configuration.new(@options_proc.call(*args), @model) ScopeOptions.new(@name, @model, config).to_relation } end |