I am confused by what is going on in the Nokogiri docs.
As far as i can judge if
require 'nokogiri' some_html = "<html><body><h1>Mr. Belvedere Fan Club</h1></body></html>"
then these three lines do the same thing:
html_doc = Nokogiri::HTML::Document.parse(some_html) html_doc = Nokogiri::HTML.parse(some_html) html_doc = Nokogiri::HTML(some_html)
The second is just a convenience method for the first. But for my eyes other than Ruby, the third one looks like it passes an argument to the module, not the method. I understand that Ruby has constructors, but I thought they took the form of Class.new, not Module (args). What's going on here?
ruby
bsamek
source share