Class: Melitta::Filters::PassThrough

Inherits:
Base
  • Object
show all
Defined in:
lib/melitta/filters/pass_through.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#coercer, #required

Instance Method Summary collapse

Instance Attribute Details

#second_level_filterObject (readonly)

Returns the value of attribute second_level_filter.



5
6
7
# File 'lib/melitta/filters/pass_through.rb', line 5

def second_level_filter
  @second_level_filter
end

Instance Method Details

#filter(field, filter) ⇒ Object



15
16
17
# File 'lib/melitta/filters/pass_through.rb', line 15

def filter(field, filter)
  @second_level_filter = filter
end

#run(params) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/melitta/filters/pass_through.rb', line 7

def run(params)
  if second_level_filter && params.respond_to?(:each)
    result(params)
  else
    params
  end
end