module Temple::Mixins::EngineDSL

def chain_class_constructor(filter, option_filter)

def chain_class_constructor(filter, option_filter)
  local_options = option_filter.last.respond_to?(:to_hash) ? option_filter.pop.to_hash : {}
  raise(ArgumentError, 'Only symbols allowed in option filter') unless option_filter.all? {|o| Symbol === o }
  define_options(*option_filter) if respond_to?(:define_options)
  proc do |engine|
    filter.new({}.update(engine.options).delete_if {|k,v| !option_filter.include?(k) }.update(local_options))
  end
end