Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created May 20, 2017 21:11
Show Gist options
  • Save anonymous/227bd15ae70c30586b5e8f09e7800188 to your computer and use it in GitHub Desktop.
Save anonymous/227bd15ae70c30586b5e8f09e7800188 to your computer and use it in GitHub Desktop.
# Class Defined as follows...
class CraigslistPost < Nokogiri::XML::Element
def initialize(html)
if html.class != Nokogiri::XML::Element
raise 'Must initialize with a Nokogiri XML Element'
end
super(html.name,html.document)
end
# Error is as follows
[4] pry(main)> row.class
=> Nokogiri::XML::Element
[5] pry(main)> CraigslistPost.new(row)
ArgumentError: wrong number of arguments (1 for 2+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment