Class: IPT::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/ipt/tag_extraction.rb

Overview

TagExtraction

Instance Method Summary collapse

Constructor Details

#initializeFormatter

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_sObject



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