lib/nibbler.rb
def parse
      self.class.rules.each do |target, (selector, delegate, plural)|
        if plural
          send(target).concat @doc.search(selector).map { |i| parse_result(i, delegate) }
        else
          send("#{target}=", parse_result(@doc.at(selector), delegate))
        end
      end
      self
    end
def parse
      self.class.rules.each do |target, (selector, delegate, plural)|
        if plural
          send(target).concat @doc.search(selector).map { |i| parse_result(i, delegate) }
        else
          send("#{target}=", parse_result(@doc.at(selector), delegate))
        end
      end
      self
    end
def parse self . class . rules . each do | target , ( selector , delegate , plural ) | if plural send ( target ) . concat @doc . search ( selector ) . map { | i | parse_result ( i , delegate ) } else send ( "#{target}=" , parse_result ( @doc . at ( selector ) , delegate ) ) end end self end
Initialize the parser with a document
 Parse the document and save values returned by selectors
Initialize the parser with a document Parse the document and save values returned by selectors