Class: Spider

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_path) ⇒ Spider

Returns a new instance of Spider.



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

def initialize(base_path)
  @base_path     = base_path
  @ignored_links = [/.js/, /.css/]
  @data          = []
end

Instance Attribute Details

#base_pathObject (readonly)

Returns the value of attribute base_path.



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

def base_path
  @base_path
end

#dataObject (readonly)

Returns the value of attribute data.



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

def data
  @data
end

Returns the value of attribute ignored_links.



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

def ignored_links
  @ignored_links
end

Instance Method Details

#get_dataObject



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

def get_data
  get_site_data
  data
end