Class: Mindee::V2::Parsing::RawText
- Inherits:
-
Object
- Object
- Mindee::V2::Parsing::RawText
- Defined in:
- lib/mindee/v2/parsing/raw_text.rb
Overview
Raw text extracted from all pages in the document.
Instance Attribute Summary collapse
-
#pages ⇒ Array[Mindee::V2::Parsing::RawTextPage]
readonly
List of pages with their extracted text content.
Instance Method Summary collapse
-
#initialize(server_response) ⇒ RawText
constructor
A new instance of RawText.
-
#to_s ⇒ String
String representation.
Constructor Details
#initialize(server_response) ⇒ RawText
Returns a new instance of RawText.
12 13 14 15 16 17 |
# File 'lib/mindee/v2/parsing/raw_text.rb', line 12 def initialize(server_response) @pages = [] server_response.fetch('pages', []).each do |page| @pages.push RawTextPage.new(page) end end |
Instance Attribute Details
#pages ⇒ Array[Mindee::V2::Parsing::RawTextPage] (readonly)
Returns List of pages with their extracted text content.
9 10 11 |
# File 'lib/mindee/v2/parsing/raw_text.rb', line 9 def pages @pages end |
Instance Method Details
#to_s ⇒ String
String representation.
21 22 23 |
# File 'lib/mindee/v2/parsing/raw_text.rb', line 21 def to_s "#{@pages.join("\n\n")}\n" end |