module ROF::Filters

A container class for all ROF filters. What is an ROF filter? @see ROF::Filters.for @see ROF::Filter for abstract definition

Constants

AVAILABLE_FILTERS

Public Class Methods

for(filter_name, options = {}) click to toggle source

@api public

@param [String] filter_name - the named filter you want to instantiate @param [Hash] options - a hash (with symbol keys) that is used for configuring the instantiating of the filter @return [ROF::Filter] @raise ROF::Filters::UnknownFilterError if the given filter name is not registered @see ./spec/support/an_rof_filter.rb @see ROF::Filter

# File lib/rof/filters.rb, line 30
def self.for(filter_name, options = {})
  begin
    filter = AVAILABLE_FILTERS.fetch(filter_name)
  rescue KeyError
    raise UnknownFilterError.new(filter_name, AVAILABLE_FILTERS.keys)
  end
  filter.new(options)
end