Module: Otis::Hooks::ClassExtension

Defined in:
lib/otis/hooks.rb

Instance Method Summary collapse

Instance Method Details

#filter(meth, options = {}) ⇒ Object

Filter the response of a method with another method



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

def filter(meth, options = {})
  meth = meth.to_s
  class_eval %(
    def filter_for_#{meth}
      "#{options[:with]}"
    end
  )
end