Class: DocRipper::TextRipper
- Inherits:
-
Ripper::Base
- Object
- Ripper::Base
- DocRipper::TextRipper
- Defined in:
- lib/doc_ripper/text_ripper.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#text_file_path ⇒ Object
readonly
Returns the value of attribute text_file_path.
Instance Method Summary collapse
Methods inherited from Ripper::Base
Constructor Details
This class inherits a constructor from DocRipper::Ripper::Base
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
5 6 7 |
# File 'lib/doc_ripper/text_ripper.rb', line 5 def file_path @file_path end |
#text_file_path ⇒ Object (readonly)
Returns the value of attribute text_file_path.
5 6 7 |
# File 'lib/doc_ripper/text_ripper.rb', line 5 def text_file_path @text_file_path end |
Instance Method Details
#rip ⇒ Object
7 8 9 |
# File 'lib/doc_ripper/text_ripper.rb', line 7 def rip @is_ripped ||=choose_ripper end |
#text ⇒ Object
11 12 13 |
# File 'lib/doc_ripper/text_ripper.rb', line 11 def text @text ||= IO.read(@text_file_path).force_encoding("ISO-8859-1").encode("utf-8", replace: nil) if rip end |