Class: Birddog::ScopeBuilder
- Inherits:
-
Object
- Object
- Birddog::ScopeBuilder
- Defined in:
- lib/birddog/scope_builder.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(model, scope_options) ⇒ ScopeBuilder
constructor
A new instance of ScopeBuilder.
Constructor Details
#initialize(model, scope_options) ⇒ ScopeBuilder
Returns a new instance of ScopeBuilder.
9 10 11 12 |
# File 'lib/birddog/scope_builder.rb', line 9 def initialize(model, ) @options = @model = model end |
Class Method Details
.build(model, scope_options) ⇒ Object
5 6 7 |
# File 'lib/birddog/scope_builder.rb', line 5 def self.build(model, ) new(model, ).build end |
Instance Method Details
#build ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/birddog/scope_builder.rb', line 14 def build scope = @model.scoped @options.each do |k, v| scope = scope.__send__(k, v) end return scope end |