Method: FilterTable::Factory#add

Defined in:
lib/utils/filter.rb

#add(method_name, opts = {}, &block) ⇒ Object



243
244
245
246
247
248
249
250
251
# File 'lib/utils/filter.rb', line 243

def add(method_name, opts = {}, &block)
  if method_name.nil?
    throw RuntimeError, "Called filter.add for resource #{@resource} with method name nil!"
  end

  @connectors[method_name.to_sym] =
    Connector.new(opts[:field] || method_name, block, opts)
  self
end