Module: ActiveInteraction::Missable

Extended by:
ActiveSupport::Concern
Included in:
ArrayFilter, Base, HashFilter
Defined in:
lib/active_interaction/concerns/missable.rb

Overview

Handle common ‘method_missing` functionality.

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(slug, *args) {|klass, args, options| ... } ⇒ Missable (private)

Parameters:

  • slug (Symbol)

Yields:

  • (klass, args, options)

Yield Parameters:

  • klass (Class)
  • args (Array)
  • options (Hash)

Returns:



21
22
23
24
25
26
27
28
29
# File 'lib/active_interaction/concerns/missable.rb', line 21

def method_missing(slug, *args)
  return super unless (klass = filter(slug))

  options = args.last.is_a?(Hash) ? args.pop : {}

  yield(klass, args, options) if block_given?

  self
end