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.
-
#layout_regions ⇒ Object
Returns the value of attribute layout_regions.
-
#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.
148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/kreuzberg/result.rb', line 148 PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank, :layout_regions) 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, layout_regions: layout_regions&.map(&:to_h) } end end |
#hierarchy ⇒ PageHierarchy? (readonly)
Returns Hierarchy information for the page.
148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/kreuzberg/result.rb', line 148 PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank, :layout_regions) 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, layout_regions: layout_regions&.map(&:to_h) } end end |
#images ⇒ Array<Image> (readonly)
Returns Images on this page.
148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/kreuzberg/result.rb', line 148 PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank, :layout_regions) 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, layout_regions: layout_regions&.map(&:to_h) } end end |
#is_blank ⇒ Object
Returns the value of attribute is_blank
148 149 150 |
# File 'lib/kreuzberg/result.rb', line 148 def is_blank @is_blank end |
#layout_regions ⇒ Object
Returns the value of attribute layout_regions
148 149 150 |
# File 'lib/kreuzberg/result.rb', line 148 def layout_regions @layout_regions end |
#page_number ⇒ Integer (readonly)
Returns Page number (1-indexed).
148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/kreuzberg/result.rb', line 148 PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank, :layout_regions) 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, layout_regions: layout_regions&.map(&:to_h) } end end |
#tables ⇒ Array<Table> (readonly)
Returns Tables on this page.
148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/kreuzberg/result.rb', line 148 PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank, :layout_regions) 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, layout_regions: layout_regions&.map(&:to_h) } end end |
Instance Method Details
#to_h ⇒ Object
149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/kreuzberg/result.rb', line 149 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, layout_regions: layout_regions&.map(&:to_h) } end |