Class: PageRankr::Index
- Inherits:
-
Object
- Object
- PageRankr::Index
- Defined in:
- lib/page_rankr/index.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#indexes ⇒ Object
(also: #tracked)
readonly
Returns the value of attribute indexes.
Instance Method Summary collapse
- #clean(backlink_count) ⇒ Object
-
#initialize(site) ⇒ Index
constructor
A new instance of Index.
Constructor Details
#initialize(site) ⇒ Index
Returns a new instance of Index.
9 10 11 |
# File 'lib/page_rankr/index.rb', line 9 def initialize(site) @indexes = clean Nokogiri::HTML(open url(site)).at(xpath).to_s end |
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
13 14 15 |
# File 'lib/page_rankr/index.rb', line 13 def clean(backlink_count) backlink_count.gsub(/[a-zA-Z,\s\(\)]/, '').to_i end |