Class: Dorsale::SmallData::FilterStrategy
- Inherits:
-
Object
- Object
- Dorsale::SmallData::FilterStrategy
show all
- Defined in:
- app/models/dorsale/small_data/filter_strategy.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of FilterStrategy.
4
5
6
|
# File 'app/models/dorsale/small_data/filter_strategy.rb', line 4
def initialize(target)
@target = target
end
|
Instance Method Details
#applies?(target) ⇒ Boolean
22
23
24
|
# File 'app/models/dorsale/small_data/filter_strategy.rb', line 22
def applies?(target)
@target == target
end
|
#apply(query) ⇒ Object
14
15
16
17
18
19
20
|
# File 'app/models/dorsale/small_data/filter_strategy.rb', line 14
def apply(query)
if @value and @value != ''
do_apply(query)
else
query
end
end
|
#set(key, value) ⇒ Object
8
9
10
11
12
|
# File 'app/models/dorsale/small_data/filter_strategy.rb', line 8
def set(key, value)
@key = key
@value = value
return self
end
|