Class: Bookbinder::Spider::Result

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

Instance Method Summary collapse

Constructor Details

#initialize(broken_links, sitemap, app_dir) ⇒ Result

Returns a new instance of Result.



11
12
13
14
15
# File 'lib/bookbinder/spider.rb', line 11

def initialize(broken_links, sitemap, app_dir)
  @broken_links = broken_links
  @sitemap = sitemap
  @app_dir = app_dir
end

Instance Method Details

#has_broken_links?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/bookbinder/spider.rb', line 17

def has_broken_links?
  @broken_links.any?
end

#to_pathObject



25
26
27
# File 'lib/bookbinder/spider.rb', line 25

def to_path
  Pathname(@app_dir).join('public/sitemap.xml')
end

#to_xmlObject



21
22
23
# File 'lib/bookbinder/spider.rb', line 21

def to_xml
  @sitemap
end