Method: MdnQuery::Document#initialize

Defined in:
lib/mdn_query/document.rb

#initialize(title, url = nil) ⇒ MdnQuery::Document

Creates a new document with an initial top level section.

Parameters:

  • title (String)

    the titel of the top level section

  • url (String) (defaults to: nil)

    the URL to the document on the web



35
36
37
38
39
# File 'lib/mdn_query/document.rb', line 35

def initialize(title, url = nil)
  @title = title
  @url = url
  @section = MdnQuery::Section.new(title)
end