Class: ClockWindow::Filters

Inherits:
Object
  • Object
show all
Defined in:
lib/clock_window/filters.rb

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ Filters

Returns a new instance of Filters.



3
4
5
6
7
8
9
10
11
# File 'lib/clock_window/filters.rb', line 3

def initialize(**kwargs)
  @title_range = kwargs.fetch(:title_range)     { 0..60 }
  @lazy_matchers = kwargs.fetch(:lazy_matchers) { true  }
  @no_notify = kwargs.fetch(:no_notify)         { false }

  # These are destructive matchers.  String will conform to match data.
  @matches = Array(kwargs.fetch(:matches)           { [] }) # [/(thing)/, /(in)/] # parenthesis takes priority
  @substitutions = Array(kwargs.fetch(:substitutions) { [] }) # [[//,'']]
end

Instance Method Details

#call(source) ⇒ Object



13
14
15
# File 'lib/clock_window/filters.rb', line 13

def call(source)
  apply_filters(source)
end