Class: Crawler
- Inherits:
-
Object
- Object
- Crawler
- Defined in:
- lib/contentar/crawler.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #get_data ⇒ Object
-
#initialize(data) ⇒ Crawler
constructor
A new instance of Crawler.
Constructor Details
#initialize(data) ⇒ Crawler
Returns a new instance of Crawler.
3 4 5 |
# File 'lib/contentar/crawler.rb', line 3 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
2 3 4 |
# File 'lib/contentar/crawler.rb', line 2 def data @data end |
Instance Method Details
#get_data ⇒ Object
7 8 9 10 11 12 |
# File 'lib/contentar/crawler.rb', line 7 def get_data data.each_with_index.inject([]) do |updated_data, (page_data, index)| updated_data << get_page_data(page_data, index) updated_data end end |