Module: Wrapomatic::Line::Processor Private

Defined in:
lib/wrapomatic/line/processor.rb,
lib/wrapomatic/line/processor/base.rb,
lib/wrapomatic/line/processor/primary.rb,
lib/wrapomatic/line/processor/remainder.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

A deep and dark module that really shouldn’t be used directly

Defined Under Namespace

Classes: Base, Primary, Remainder

Class Method Summary collapse

Class Method Details

.process(line) ⇒ Array<String>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Process a line

Parameters:

  • a (Line)

    Line object to process

Returns:

  • (Array<String>)

    the processed line, broken into individually wrapped lines



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/wrapomatic/line/processor.rb', line 18

def self.process(line)
  columns = line.columns
  indents = line.indents
  text = line.indented

  [Primary.new(text, columns).content] +
    line.class.new(
      Remainder.new(text, columns).content,
      indents,
      columns
    ).wrapped
end