Class: Contentar

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(baseurl) ⇒ Contentar

Returns a new instance of Contentar.



4
5
6
7
8
# File 'lib/contentar.rb', line 4

def initialize(baseurl)
  @baseurl = baseurl
  @spider  = Spider.new(baseurl)
  @crawler = Crawler.new(spider.get_data)
end

Instance Attribute Details

#baseurlObject (readonly)

Returns the value of attribute baseurl.



3
4
5
# File 'lib/contentar.rb', line 3

def baseurl
  @baseurl
end

#crawlerObject (readonly)

Returns the value of attribute crawler.



3
4
5
# File 'lib/contentar.rb', line 3

def crawler
  @crawler
end

#saverObject (readonly)

Returns the value of attribute saver.



3
4
5
# File 'lib/contentar.rb', line 3

def saver
  @saver
end

#spiderObject (readonly)

Returns the value of attribute spider.



3
4
5
# File 'lib/contentar.rb', line 3

def spider
  @spider
end

Instance Method Details

#save_dataObject



10
11
12
# File 'lib/contentar.rb', line 10

def save_data
  DataSaver.csv(csv_filename, crawler.get_data)
end