Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Thanks for your comments. I fixed the first two issues—thanks for catching them!

    There are plenty of situations where having this in a separate class would be useful: you may want to initialize an instance once with an unknown parameter and then use that same instance a number of different times throughout your application, without having to specify unknown again.

    You could compare it to Redcarpet's API, e.g. (taken from its Readme):

    # Initializes a Markdown parser
    markdown = Redcarpet::Markdown.new(renderer, extensions = {})
    
    markdown.render("This is *bongos*, indeed.")
    # => "<p>This is <em>bongos</em>, indeed.</p>"
    

    What would you have done instead?