Class: AdventOfCodeGenerator::HTMLParser

Inherits:
Object
  • Object
show all
Defined in:
lib/advent_of_code_generator/html_parser.rb

Overview

Converts HTML puzzle descriptions from adventofcode.com into markdown format.

Instance Method Summary collapse

Constructor Details

#initialize(html_content) ⇒ HTMLParser

Returns a new instance of HTMLParser.



8
9
10
# File 'lib/advent_of_code_generator/html_parser.rb', line 8

def initialize(html_content)
  @html_content = html_content
end

Instance Method Details

#callObject



12
13
14
15
16
17
18
# File 'lib/advent_of_code_generator/html_parser.rb', line 12

def call
  {
    puzzle_description: part_descriptions.join("\n"),
    test_input:,
    test_expectations:
  }
end