Class: Mindee::Parsing::V2::RawText
- Inherits:
-
Object
- Object
- Mindee::Parsing::V2::RawText
- Defined in:
- lib/mindee/parsing/v2/raw_text.rb
Overview
Raw text extracted from all pages in the document.
Instance Attribute Summary collapse
-
#pages ⇒ Array[Mindee::Parsing::V2::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 ⇒ Object
Constructor Details
#initialize(server_response) ⇒ RawText
Returns a new instance of RawText.
12 13 14 15 16 17 |
# File 'lib/mindee/parsing/v2/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::Parsing::V2::RawTextPage] (readonly)
Returns List of pages with their extracted text content.
9 10 11 |
# File 'lib/mindee/parsing/v2/raw_text.rb', line 9 def pages @pages end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/mindee/parsing/v2/raw_text.rb', line 19 def to_s "#{@pages.map(&:to_s).join("\n\n")}\n" end |