lib/page_rankr/rank.rb in PageRankr-2.0.4 vs lib/page_rankr/rank.rb in PageRankr-3.0.0

- old
+ new

@@ -1,20 +1,9 @@ +require File.expand_path('../tracker', __FILE__) + module PageRankr module Rank - attr_reader :rank - alias_method :tracked, :rank - - def initialize(site) - @site = site - - request.on_complete do |response| - html = Nokogiri::HTML(response.body) - @rank = clean(html.search(xpath)) - @rank = nil if @rank.zero? - end - end - - def clean(rank) - rank.to_s.to_i - end + include Tracker + + alias_method :rank, :tracked end end \ No newline at end of file