Class: ESearchy::PageTextReceiver

Inherits:
Object
  • Object
show all
Defined in:
lib/esearchy/docs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePageTextReceiver

Returns a new instance of PageTextReceiver.



5
6
7
# File 'lib/esearchy/docs.rb', line 5

def initialize
  @content = []
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



3
4
5
# File 'lib/esearchy/docs.rb', line 3

def content
  @content
end

Instance Method Details

#begin_page(arg = nil) ⇒ Object

Called when page parsing starts



10
11
12
# File 'lib/esearchy/docs.rb', line 10

def begin_page(arg = nil)
  @content << ""
end

#show_text(string, *params) ⇒ Object Also known as: super_show_text, move_to_next_line_and_show_text, set_spacing_next_line_show_text

record text that is drawn on the page



15
16
17
# File 'lib/esearchy/docs.rb', line 15

def show_text(string, *params)
  @content.last << string.strip
end

#show_text_with_positioning(*params) ⇒ Object

this final text callback takes slightly different arguments



25
26
27
28
# File 'lib/esearchy/docs.rb', line 25

def show_text_with_positioning(*params)
  params = params.first
  params.each { |str| show_text(str) if str.kind_of?(String)}
end