Module: Aws::Templates::Utils::Contextualized::Filter::Dsl::FilterFactory

Defined in:
lib/aws/templates/utils/contextualized/filter/dsl.rb

Overview

Mixin for filter factory method

Adds filter factory method to the target

Instance Method Summary collapse

Instance Method Details

#filter(type, *args, &blk) ⇒ Object

Filter factory method

It creates a filter based on type identifier and parameters with optional block which will be passed unchanged to the filter constructor.

  • type - type identifier; can by either symbol or string

  • args - filter constructor arguments

  • blk - optional block to be passed to filter constructor



29
30
31
# File 'lib/aws/templates/utils/contextualized/filter/dsl.rb', line 29

def filter(type, *args, &blk)
  Filter.const_get(type.to_s.modulize).new(*args, &blk)
end