Class: Kreuzberg::Config::HtmlPreprocessing

Inherits:
Object
  • Object
show all
Defined in:
lib/kreuzberg/config.rb

Overview

HTML preprocessing configuration for content extraction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled: nil, preset: nil, remove_navigation: nil, remove_forms: nil) ⇒ HtmlPreprocessing

Returns a new instance of HtmlPreprocessing.



611
612
613
614
615
616
# File 'lib/kreuzberg/config.rb', line 611

def initialize(enabled: nil, preset: nil, remove_navigation: nil, remove_forms: nil)
  @enabled = boolean_or_nil(enabled)
  @preset = preset&.to_sym
  @remove_navigation = boolean_or_nil(remove_navigation)
  @remove_forms = boolean_or_nil(remove_forms)
end

Instance Attribute Details

#enabledObject (readonly)

Returns the value of attribute enabled.



609
610
611
# File 'lib/kreuzberg/config.rb', line 609

def enabled
  @enabled
end

#presetObject (readonly)

Returns the value of attribute preset.



609
610
611
# File 'lib/kreuzberg/config.rb', line 609

def preset
  @preset
end

#remove_formsObject (readonly)

Returns the value of attribute remove_forms.



609
610
611
# File 'lib/kreuzberg/config.rb', line 609

def remove_forms
  @remove_forms
end

#remove_navigationObject (readonly)

Returns the value of attribute remove_navigation.



609
610
611
# File 'lib/kreuzberg/config.rb', line 609

def remove_navigation
  @remove_navigation
end

Instance Method Details

#to_hObject



618
619
620
621
622
623
624
625
# File 'lib/kreuzberg/config.rb', line 618

def to_h
  {
    enabled: @enabled,
    preset: @preset,
    remove_navigation: @remove_navigation,
    remove_forms: @remove_forms
  }.compact
end