Class: Ocelot::Rules::Filter

Inherits:
Base
  • Object
show all
Defined in:
lib/ocelot/rules.rb

Direct Known Subclasses

ScriptFilter

Instance Method Summary collapse

Methods inherited from Base

#connection, #in?, #logger, #obj_to_s, #remove_callbacks, #safely

Instance Method Details

#filter(value) ⇒ Object



8
9
10
# File 'lib/ocelot/rules.rb', line 8

def filter(value)
  true
end

#load(obj, collection, name) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/ocelot/rules.rb', line 12

def load(obj, collection, name)
  result = []
  collection.each do |val|
    safely(obj, name) do
      result << val if filter val
    end
  end
end