class HtmlToHaml::Html::ConversionUseCase

Public Class Methods

new(html, remove_whitespace: true) click to toggle source
# File lib/html_to_haml/use_cases/html/conversion_use_case.rb, line 8
def initialize(html, remove_whitespace: true)
  @html = html
  @remove_whitespace = remove_whitespace
end

Public Instance Methods

convert() click to toggle source
# File lib/html_to_haml/use_cases/html/conversion_use_case.rb, line 13
def convert
  html_with_haml_comments = CommentConversionUseCase.new(@html).convert
  haml = DefaultConversionUseCase.new(html_with_haml_comments, remove_whitespace: @remove_whitespace).convert
  AttributeConversionUseCase.instance.convert_attributes(html: haml)
end