Class: Kreuzberg::Result::PageContent
- Inherits:
-
Struct
- Object
- Struct
- Kreuzberg::Result::PageContent
- Defined in:
- lib/kreuzberg/result.rb
Instance Attribute Summary collapse
-
#content ⇒ String
readonly
Text content for this page.
-
#hierarchy ⇒ PageHierarchy?
readonly
Hierarchy information for the page.
-
#images ⇒ Array<Image>
readonly
Images on this page.
-
#is_blank ⇒ Object
Returns the value of attribute is_blank.
-
#page_number ⇒ Integer
readonly
Page number (1-indexed).
-
#tables ⇒ Array<Table>
readonly
Tables on this page.
Instance Method Summary collapse
Instance Attribute Details
#content ⇒ String (readonly)
Returns Text content for this page.
143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/kreuzberg/result.rb', line 143 PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank, keyword_init: true) do def to_h { page_number: page_number, content: content, tables: tables.map(&:to_h), images: images.map(&:to_h), hierarchy: hierarchy&.to_h, is_blank: is_blank } end end |
#hierarchy ⇒ PageHierarchy? (readonly)
Returns Hierarchy information for the page.
143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/kreuzberg/result.rb', line 143 PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank, keyword_init: true) do def to_h { page_number: page_number, content: content, tables: tables.map(&:to_h), images: images.map(&:to_h), hierarchy: hierarchy&.to_h, is_blank: is_blank } end end |
#images ⇒ Array<Image> (readonly)
Returns Images on this page.
143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/kreuzberg/result.rb', line 143 PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank, keyword_init: true) do def to_h { page_number: page_number, content: content, tables: tables.map(&:to_h), images: images.map(&:to_h), hierarchy: hierarchy&.to_h, is_blank: is_blank } end end |
#is_blank ⇒ Object
Returns the value of attribute is_blank
143 144 145 |
# File 'lib/kreuzberg/result.rb', line 143 def is_blank @is_blank end |
#page_number ⇒ Integer (readonly)
Returns Page number (1-indexed).
143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/kreuzberg/result.rb', line 143 PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank, keyword_init: true) do def to_h { page_number: page_number, content: content, tables: tables.map(&:to_h), images: images.map(&:to_h), hierarchy: hierarchy&.to_h, is_blank: is_blank } end end |
#tables ⇒ Array<Table> (readonly)
Returns Tables on this page.
143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/kreuzberg/result.rb', line 143 PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank, keyword_init: true) do def to_h { page_number: page_number, content: content, tables: tables.map(&:to_h), images: images.map(&:to_h), hierarchy: hierarchy&.to_h, is_blank: is_blank } end end |
Instance Method Details
#to_h ⇒ Object
144 145 146 147 148 149 150 151 152 153 |
# File 'lib/kreuzberg/result.rb', line 144 def to_h { page_number: page_number, content: content, tables: tables.map(&:to_h), images: images.map(&:to_h), hierarchy: hierarchy&.to_h, is_blank: is_blank } end |