Class: ChupaText::Formatters::Text

Inherits:
Object
  • Object
show all
Defined in:
lib/chupa-text/formatters/text.rb

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ Text

Returns a new instance of Text.



4
5
6
7
# File 'lib/chupa-text/formatters/text.rb', line 4

def initialize(output)
  @output = output
  @texts = []
end

Instance Method Details

#format_extracted(data) ⇒ Object



12
13
14
# File 'lib/chupa-text/formatters/text.rb', line 12

def format_extracted(data)
  @texts << data.body
end

#format_finish(data) ⇒ Object



16
17
18
19
# File 'lib/chupa-text/formatters/text.rb', line 16

def format_finish(data)
  @output << @texts.join("\n\x0c\n")
  @output << "\n"
end

#format_start(data) ⇒ Object



9
10
# File 'lib/chupa-text/formatters/text.rb', line 9

def format_start(data)
end