Class: Bookbinder::Spider::Result
- Inherits:
-
Object
- Object
- Bookbinder::Spider::Result
- Defined in:
- lib/bookbinder/spider.rb
Instance Method Summary collapse
- #announce_broken_links(streams) ⇒ Object
- #has_broken_links? ⇒ Boolean
-
#initialize(broken_links) ⇒ Result
constructor
A new instance of Result.
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
#announce_broken_links(streams) ⇒ Object
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
14 15 16 |
# File 'lib/bookbinder/spider.rb', line 14 def has_broken_links? @broken_links.any? end |