Module: PageRankr::Index
- Included in:
- PageRankr::Indexes::Bing, PageRankr::Indexes::Google
- Defined in:
- lib/page_rankr/index.rb
Instance Attribute Summary collapse
-
#indexes ⇒ Object
(also: #tracked)
readonly
Returns the value of attribute indexes.
Instance Method Summary collapse
Instance Attribute Details
#indexes ⇒ Object (readonly) Also known as: tracked
Returns the value of attribute indexes.
6 7 8 |
# File 'lib/page_rankr/index.rb', line 6 def indexes @indexes end |
Instance Method Details
#clean(backlink_count) ⇒ Object
18 19 20 |
# File 'lib/page_rankr/index.rb', line 18 def clean(backlink_count) backlink_count.gsub(/[a-zA-Z,\s\(\)]/, '').to_i end |
#initialize(site) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/page_rankr/index.rb', line 9 def initialize(site) @site = site request.on_complete do |response| html = Nokogiri::HTML(response.body) @indexes = clean(html.at(xpath).to_s) @indexes = nil if @indexes.zero? end end |