Skip to content

Commit

Permalink
remove unused methods from HTML::Document
Browse files Browse the repository at this point in the history
  • Loading branch information
tomclose committed Apr 1, 2024
1 parent 73e3166 commit 8db047d
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions lib/stimulus_reflex/html/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 8db047d

Please sign in to comment.