Class: ESearchy::PageTextReceiver
- Inherits:
-
Object
- Object
- ESearchy::PageTextReceiver
- Defined in:
- lib/esearchy/docs.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
Instance Method Summary collapse
-
#begin_page(arg = nil) ⇒ Object
Called when page parsing starts.
-
#initialize ⇒ PageTextReceiver
constructor
A new instance of PageTextReceiver.
-
#show_text(string, *params) ⇒ Object
(also: #super_show_text, #move_to_next_line_and_show_text, #set_spacing_next_line_show_text)
record text that is drawn on the page.
-
#show_text_with_positioning(*params) ⇒ Object
this final text callback takes slightly different arguments.
Constructor Details
#initialize ⇒ PageTextReceiver
Returns a new instance of PageTextReceiver.
5 6 7 |
# File 'lib/esearchy/docs.rb', line 5 def initialize @content = [] end |
Instance Attribute Details
#content ⇒ Object
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 |