Method: Lifestreamable::LifestreamableClassMethods#filter

Defined in:
lib/lifestreamable/lifestreamable.rb

#filter(lifestream) ⇒ Object



187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/lifestreamable/lifestreamable.rb', line 187

def filter(lifestream)
  option = self.lifestream_options[:filter]
  lifestream = case option
    when Proc
      option.call(self, lifestream)
    when String, Symbol
      send(option.to_s, lifestream) if respond_to?(option.to_s)
    else
      lifestream
  end 
  lifestream
end