Class: Wrapomatic::Line::Processor::Base Private
- Inherits:
-
Object
- Object
- Wrapomatic::Line::Processor::Base
- Defined in:
- lib/wrapomatic/line/processor/base.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
To create a new Line processor, inherit from this class and implement the private method ‘processed`, returning a String
The base processor from which all other processors inherit
Instance Attribute Summary collapse
-
#columns ⇒ Integer
readonly
private
The maximum number of characters in the result.
-
#text ⇒ String
readonly
private
The text being processed.
Instance Method Summary collapse
-
#content ⇒ String
private
The content after processing.
-
#initialize(text, columns) ⇒ Base
constructor
private
A new instance of Base.
Constructor Details
#initialize(text, columns) ⇒ Base
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.
Returns a new instance of Base.
30 31 32 |
# File 'lib/wrapomatic/line/processor/base.rb', line 30 def initialize(text, columns) @text, @columns = text, columns end |
Instance Attribute Details
#columns ⇒ Integer (readonly)
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.
Returns the maximum number of characters in the result.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/wrapomatic/line/processor/base.rb', line 23 class Base attr_reader :text, :columns # @param text [String] the text to process # # @param columns [Integer] the column cutoff at which the line should # be wrapped def initialize(text, columns) @text, @columns = text, columns end # The content after processing # # @return [String] the line part resulting from processing def content processed end private def processed text end end |
#text ⇒ String (readonly)
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.
Returns the text being processed.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/wrapomatic/line/processor/base.rb', line 23 class Base attr_reader :text, :columns # @param text [String] the text to process # # @param columns [Integer] the column cutoff at which the line should # be wrapped def initialize(text, columns) @text, @columns = text, columns end # The content after processing # # @return [String] the line part resulting from processing def content processed end private def processed text end end |
Instance Method Details
#content ⇒ 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.
The content after processing
37 38 39 |
# File 'lib/wrapomatic/line/processor/base.rb', line 37 def content processed end |