Class: Uttk::Filters::TextFilter

Inherits:
KeepSkipBased show all
Includes:
Concrete
Defined in:
lib/uttk/filters/TextFilter.rb

Instance Attribute Summary

Attributes inherited from KeepSkipBased

#keep, #skip

Instance Method Summary collapse

Methods inherited from KeepSkipBased

#keep?, #skip?

Methods inherited from Filter

composition, #notif

Methods inherited from Logger::Backend

#update

Constructor Details

#initialize(observers, options, &b) ⇒ TextFilter

FIXME can be path based This filter use the Text manipulation class of RubyEx. You can apply transformation over leaves content.

This filter takes two arguments:

- observers: An observer list like any filter
- options:
    keep:   A regular expression (all keys which match this regexp are transformed)
    skip:   Antoher regexp that skip keys which match
    action: What transformation apply (e.g. justify), see the _Text_ class for
            more informations
    width:  Maximal width of a line

Examples:

Yaml syntax: 'TextFilter: [!keep "^(in|out)put$", !action justify, Yaml]'


31
32
33
34
35
# File 'lib/uttk/filters/TextFilter.rb', line 31

def initialize ( observers, options, &b )
  super
  @text_factory = MetaFactory.new(Text, @options)
  @filter_next_leaf = false
end