Class: SimpleFilter::Base

Inherits:
Object
  • Object
show all
Extended by:
Filter
Defined in:
lib/simple_filter/base.rb

Instance Attribute Summary collapse

Attributes included from Filter

#filters

Instance Method Summary collapse

Methods included from Filter

filter

Constructor Details

#initialize(params = {}, scope = nil) ⇒ Base

Returns a new instance of Base.



7
8
9
10
# File 'lib/simple_filter/base.rb', line 7

def initialize(params = {}, scope = nil)
  @params = params
  @scope = scope
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



5
6
7
# File 'lib/simple_filter/base.rb', line 5

def params
  @params
end

#scopeObject (readonly)

Returns the value of attribute scope.



5
6
7
# File 'lib/simple_filter/base.rb', line 5

def scope
  @scope
end

Instance Method Details

#scoping(scope) ⇒ Object



12
13
14
15
16
# File 'lib/simple_filter/base.rb', line 12

def scoping(scope)
  @scope = scope

  self
end

#searchObject



18
19
20
# File 'lib/simple_filter/base.rb', line 18

def search
  conditions.scope
end