Class: Kreuzberg::Config::PDF
- Inherits:
-
Object
- Object
- Kreuzberg::Config::PDF
- Defined in:
- lib/kreuzberg/config.rb
Overview
PDF-specific options
Instance Attribute Summary collapse
-
#extract_images ⇒ Object
readonly
Returns the value of attribute extract_images.
-
#extract_metadata ⇒ Object
readonly
Returns the value of attribute extract_metadata.
-
#font_config ⇒ Object
Returns the value of attribute font_config.
-
#hierarchy ⇒ Object
Returns the value of attribute hierarchy.
-
#passwords ⇒ Object
readonly
Returns the value of attribute passwords.
Instance Method Summary collapse
-
#initialize(extract_images: false, passwords: nil, extract_metadata: true, font_config: nil, hierarchy: nil) ⇒ PDF
constructor
A new instance of PDF.
- #to_h ⇒ Object
Constructor Details
#initialize(extract_images: false, passwords: nil, extract_metadata: true, font_config: nil, hierarchy: nil) ⇒ PDF
Returns a new instance of PDF.
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/kreuzberg/config.rb', line 396 def initialize( extract_images: false, passwords: nil, extract_metadata: true, font_config: nil, hierarchy: nil ) @extract_images = extract_images ? true : false @passwords = if passwords.is_a?(Array) passwords.map(&:to_s) else (passwords ? [passwords.to_s] : nil) end @extract_metadata = ? true : false @font_config = normalize_font_config(font_config) @hierarchy = normalize_hierarchy(hierarchy) end |
Instance Attribute Details
#extract_images ⇒ Object (readonly)
Returns the value of attribute extract_images.
394 395 396 |
# File 'lib/kreuzberg/config.rb', line 394 def extract_images @extract_images end |
#extract_metadata ⇒ Object (readonly)
Returns the value of attribute extract_metadata.
394 395 396 |
# File 'lib/kreuzberg/config.rb', line 394 def @extract_metadata end |
#font_config ⇒ Object
Returns the value of attribute font_config.
394 395 396 |
# File 'lib/kreuzberg/config.rb', line 394 def font_config @font_config end |
#hierarchy ⇒ Object
Returns the value of attribute hierarchy.
394 395 396 |
# File 'lib/kreuzberg/config.rb', line 394 def hierarchy @hierarchy end |
#passwords ⇒ Object (readonly)
Returns the value of attribute passwords.
394 395 396 |
# File 'lib/kreuzberg/config.rb', line 394 def passwords @passwords end |
Instance Method Details
#to_h ⇒ Object
414 415 416 417 418 419 420 421 422 |
# File 'lib/kreuzberg/config.rb', line 414 def to_h { extract_images: @extract_images, passwords: @passwords, extract_metadata: @extract_metadata, font_config: @font_config&.to_h, hierarchy: @hierarchy&.to_h }.compact end |