Class: Mixboard::Filter

Inherits:
Object
  • Object
show all
Includes:
UtilityFunctions
Defined in:
app/mixer/mixboard/filter.rb

Overview

Filters interrupt the flow of signals through the system. You can add filters before or after channels and signal processors

Instance Method Summary collapse

Methods included from UtilityFunctions

#assert_non_nil_of_type, #assert_type, #declare_abstract_method_body, #method_not_implemented_error

Instance Method Details

#do_filter(signal) ⇒ Object



20
21
22
23
24
25
# File 'app/mixer/mixboard/filter.rb', line 20

def do_filter(signal)
  assert_non_nil_of_type(signal, signal_class)
  signal = filter(signal)
  assert_type(signal, signal_class)
  signal
end

#filter(_signal) ⇒ Signal?

Returns the filtered signal or nil.

Parameters:

Returns:

  • (Signal, nil)

    the filtered signal or nil



16
17
18
# File 'app/mixer/mixboard/filter.rb', line 16

def filter(_signal)
  declare_abstract_method_body
end

#signal_classClass

Returns the Signal subclass that this filter applies to.

Returns:

  • (Class)

    the Signal subclass that this filter applies to



10
11
12
# File 'app/mixer/mixboard/filter.rb', line 10

def signal_class
  declare_abstract_method_body
end