class Wrapomatic::Line::Processor::Base

The base processor from which all other processors inherit

@note To create a new Line processor, inherit from this class and

implement the private method `processed`, returning a String

@example Creating A New Line Processor

class MyProcessor < Wrapomatic::Line::Processor::Base
  private
  def processed
    "the conent that we want to pass back after processing"
  end
end

@!attribute [r] text

@return [String] the text being processed

@!attribute [r] columns

@return [Integer] the maximum number of characters in the result

Attributes

columns[R]
text[R]

Public Class Methods

new(text, columns) click to toggle source

@param text [String] the text to process

@param columns [Integer] the column cutoff at which the line should

be wrapped
# File lib/wrapomatic/line/processor/base.rb, line 30
def initialize(text, columns)
  @text, @columns = text, columns
end

Public Instance Methods

content() click to toggle source

The content after processing

@return [String] the line part resulting from processing

# File lib/wrapomatic/line/processor/base.rb, line 37
def content
  processed
end

Private Instance Methods

processed() click to toggle source
# File lib/wrapomatic/line/processor/base.rb, line 42
def processed
  text
end