Class: Kreuzberg::Config::PageConfig
- Inherits:
-
Object
- Object
- Kreuzberg::Config::PageConfig
- Defined in:
- lib/kreuzberg/config.rb
Overview
Page tracking configuration for multi-page documents
Instance Attribute Summary collapse
-
#extract_pages ⇒ Object
readonly
Returns the value of attribute extract_pages.
-
#insert_page_markers ⇒ Object
readonly
Returns the value of attribute insert_page_markers.
-
#marker_format ⇒ Object
readonly
Returns the value of attribute marker_format.
Instance Method Summary collapse
-
#initialize(extract_pages: false, insert_page_markers: false, marker_format: "\n\n<!-- PAGE {page_num} -->\n\n") ⇒ PageConfig
constructor
A new instance of PageConfig.
- #to_h ⇒ Object
Constructor Details
#initialize(extract_pages: false, insert_page_markers: false, marker_format: "\n\n<!-- PAGE {page_num} -->\n\n") ⇒ PageConfig
Returns a new instance of PageConfig.
751 752 753 754 755 756 757 758 759 760 |
# File 'lib/kreuzberg/config.rb', line 751 def initialize( extract_pages: false, insert_page_markers: false, marker_format: "\n\n<!-- PAGE {page_num} -->\n\n" ) # Handle boolean conversion: treat 0 as false (like in C/FFI), but other truthy values as true @extract_pages = !extract_pages.nil? && extract_pages != false && extract_pages != 0 @insert_page_markers = !insert_page_markers.nil? && insert_page_markers != false && insert_page_markers != 0 @marker_format = marker_format.to_s end |
Instance Attribute Details
#extract_pages ⇒ Object (readonly)
Returns the value of attribute extract_pages.
749 750 751 |
# File 'lib/kreuzberg/config.rb', line 749 def extract_pages @extract_pages end |
#insert_page_markers ⇒ Object (readonly)
Returns the value of attribute insert_page_markers.
749 750 751 |
# File 'lib/kreuzberg/config.rb', line 749 def insert_page_markers @insert_page_markers end |
#marker_format ⇒ Object (readonly)
Returns the value of attribute marker_format.
749 750 751 |
# File 'lib/kreuzberg/config.rb', line 749 def marker_format @marker_format end |
Instance Method Details
#to_h ⇒ Object
762 763 764 765 766 767 768 |
# File 'lib/kreuzberg/config.rb', line 762 def to_h { extract_pages: @extract_pages, insert_page_markers: @insert_page_markers, marker_format: @marker_format } end |