Class: Crawler

Inherits:
Object
  • Object
show all
Defined in:
lib/contentar/crawler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (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_dataObject



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