Class: Bookbinder::Spider::Result

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

Instance Method Summary collapse

Constructor Details

#initialize(broken_links) ⇒ Result

Returns a new instance of Result.



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

def initialize(broken_links)
  @broken_links = broken_links
end

Instance Method Details



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/bookbinder/spider.rb', line 18

def announce_broken_links(streams)
  if @broken_links.none?
    streams[:out].puts "\nNo broken links!"
  else
    streams[:err].puts("\nFound \#{@broken_links.count} broken links!\n\n\#{@broken_links.sort.join(\"\\n\")}\n\nFound \#{@broken_links.count} broken links!\n    MESSAGE\n  end\nend\n")

#has_broken_links?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/bookbinder/spider.rb', line 14

def has_broken_links?
  @broken_links.any?
end