Allow passing options to the ChainedFilter via an Array #64

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant

ahx commented Feb 21, 2013

The ChainedFilter is really handy. I wanted to adjust the used filters a little, so this patch allows to pass options via an Array like:

filter Web::Filters::ChainedFilter, {
  types: {
    erb: [Web::Filters::TiltFilter, {}, my_context],
    haml: [Web::Filters::TiltFilter, {}, my_context],
    coffee: CoffeeScriptFilter
  }
}

I chose an Array to pass the options, because it's easy and resembles the filter syntax filter MyClass, option1, option2.

I am not using #register right now. You could also pass an Array to that method, but maybe we should change the register method to allow something like register :type, MyFilter, option1, option2, ping me if you think that's a good idea.

@ahx ahx Allow passing options to the ChainedFilter via an Array
Passing Options via an Array is easy and resembles the filter syntax `filter MyClass, option1, option2`.
0a18278
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment