From 8db047de66993af764c366d726662eae57e844b8 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Mon, 1 Apr 2024 23:30:44 +0100 Subject: [PATCH] remove unused methods from HTML::Document --- lib/stimulus_reflex/html/document.rb | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/lib/stimulus_reflex/html/document.rb b/lib/stimulus_reflex/html/document.rb index 80f6eea8..0f379ac9 100644 --- a/lib/stimulus_reflex/html/document.rb +++ b/lib/stimulus_reflex/html/document.rb @@ -5,26 +5,9 @@ module HTML class Document DEFAULT_HTML_WITHOUT_FORMAT = Nokogiri::XML::Node::SaveOptions::DEFAULT_HTML & ~Nokogiri::XML::Node::SaveOptions::FORMAT - delegate :element, to: :@document - - def document_element - @document&.root - end - - def outer_html - document_element ? document_element.to_html(save_with: DEFAULT_HTML_WITHOUT_FORMAT) : "" - end - alias_method :to_html, :outer_html - - def inner_html - document_element ? document_element.inner_html(save_with: DEFAULT_HTML_WITHOUT_FORMAT) : "" - end - def initialize(html) @document = parsing_class.parse(html.to_s) - @matches = { - "body" => Match.new(@document.at_css("body")) - } + @matches = {} end def empty?