Class: ActiveInteraction::ArrayFilter

Inherits:
Filter
  • Object
show all
Includes:
Missable
Defined in:
lib/active_interaction/filters/array_filter.rb

Instance Attribute Summary

Attributes inherited from Filter

#filters, #name, #options

Method Summary

Methods inherited from Filter

#clean, #database_column_type, #default, #default?, #desc, factory, #initialize

Constructor Details

This class inherits a constructor from ActiveInteraction::Filter

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(&block) ⇒ Object (private)

rubocop:disable Style/MissingRespondToMissing



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/active_interaction/filters/array_filter.rb', line 86

def method_missing(*, &block)
  super do |klass, names, options|
    options = add_option_in_place_of_name(klass, options)

    filter = klass.new(names.first || '', options, &block)

    filters[filters.size.to_s.to_sym] = filter

    validate!(filter, names)
  end
end