Class: IPT::Formatter
- Inherits:
-
Object
- Object
- IPT::Formatter
- Defined in:
- lib/ipt/tag_extraction.rb
Overview
TagExtraction
Instance Method Summary collapse
- #clear(txt) ⇒ Object
-
#initialize ⇒ Formatter
constructor
A new instance of Formatter.
- #reset! ⇒ Object
- #to_s ⇒ Object
- #yellow(txt) ⇒ Object
Constructor Details
#initialize ⇒ Formatter
Returns a new instance of Formatter.
37 38 39 |
# File 'lib/ipt/tag_extraction.rb', line 37 def initialize reset! end |
Instance Method Details
#clear(txt) ⇒ Object
46 47 48 49 |
# File 'lib/ipt/tag_extraction.rb', line 46 def clear(txt) @buffer << txt self end |
#reset! ⇒ Object
51 52 53 |
# File 'lib/ipt/tag_extraction.rb', line 51 def reset! @buffer = [] end |
#to_s ⇒ Object
55 56 57 |
# File 'lib/ipt/tag_extraction.rb', line 55 def to_s @buffer.join('') end |
#yellow(txt) ⇒ Object
41 42 43 44 |
# File 'lib/ipt/tag_extraction.rb', line 41 def yellow(txt) @buffer << "\033[33m#{txt}\033[0m" self end |