lib/page_rankr/ranks.rb in PageRankr-1.3.0 vs lib/page_rankr/ranks.rb in PageRankr-1.4.0
- old
+ new
@@ -1,26 +1,14 @@
+require File.join("page_rankr", "ranks", "rank")
require File.join("page_rankr", "ranks", "alexa")
require File.join("page_rankr", "ranks", "google")
module PageRankr
- class Ranks
- attr_reader :rank_trackers
+ class Ranks < Tracker
+ alias_method :rank_trackers, :site_trackers
def initialize
- @rank_trackers = self.class.constants
- end
-
- def lookup(site, *trackers)
- trackers = rank_trackers if trackers.empty?
-
- ranks = {}
- trackers.each do |tracker|
- name, klass = tracker.to_s.capitalize, self.class
-
- next unless klass.const_defined? name
-
- ranks[tracker.to_s.downcase.to_sym] = klass.const_get(name).new(site).rank
- end
- ranks
+ super
+ @site_trackers.delete(:rank)
end
end
end
\ No newline at end of file