Class: Kadmin::Finder::Filter

Inherits:
Object
  • Object
show all
Defined in:
app/components/kadmin/finder/filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, scope) ⇒ Filter

Returns a new instance of Filter.



9
10
11
12
13
# File 'app/components/kadmin/finder/filter.rb', line 9

def initialize(name, scope)
  @name = name
  @scope = scope
  @value = nil
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



6
7
8
# File 'app/components/kadmin/finder/filter.rb', line 6

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'app/components/kadmin/finder/filter.rb', line 7

def value
  @value
end

Instance Method Details

#apply(scope, value) ⇒ Object



15
16
17
18
# File 'app/components/kadmin/finder/filter.rb', line 15

def apply(scope, value)
  @value = value
  scope.merge(scope.instance_exec(value, &@scope))
end