Class: ActiveInteraction::HashFilter
- Inherits:
-
Filter
- Object
- Filter
- ActiveInteraction::HashFilter
- Defined in:
- lib/mtk_framework/gem_extensions/active_interaction/filters/hash_filter.rb
Instance Method Summary collapse
-
#import_filters(klass, options = {}) ⇒ Object
Import filters from another interaction.
Instance Method Details
#import_filters(klass, options = {}) ⇒ Object
Import filters from another interaction.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/mtk_framework/gem_extensions/active_interaction/filters/hash_filter.rb', line 23 def import_filters(klass, = {}) # rubocop:disable Metrics/AbcSize only = [:only] except = [:except] groups = [:groups] || [klass.to_s.demodulize.underscore.to_sym] klass.filters.each do |name, filter| next if only && ![*only].include?(name) next if except && [*except].include?(name) = filter..merge(groups: groups) filter_copy = filter.class.new(name, ) filters[name] = filter_copy end end |