Class: Deadlink::Paths
- Inherits:
-
Object
- Object
- Deadlink::Paths
- Defined in:
- lib/deadlink/paths.rb
Instance Attribute Summary collapse
-
#deadlinks ⇒ Object
readonly
Returns the value of attribute deadlinks.
Instance Method Summary collapse
- #count ⇒ Object
- #deadlink_include? ⇒ Boolean
-
#initialize(files) ⇒ Paths
constructor
A new instance of Paths.
- #print_deadlinks(opts) ⇒ Object
Constructor Details
#initialize(files) ⇒ Paths
Returns a new instance of Paths.
6 7 8 9 10 11 12 |
# File 'lib/deadlink/paths.rb', line 6 def initialize(files) @files = files @paths = [] @files.each { |file| @paths.concat(file.link_paths) } @deadlinks = @paths.select { |path| path.deadlink?(@files) } end |
Instance Attribute Details
#deadlinks ⇒ Object (readonly)
Returns the value of attribute deadlinks.
4 5 6 |
# File 'lib/deadlink/paths.rb', line 4 def deadlinks @deadlinks end |
Instance Method Details
#count ⇒ Object
22 23 24 |
# File 'lib/deadlink/paths.rb', line 22 def count @paths.count end |
#deadlink_include? ⇒ Boolean
14 15 16 |
# File 'lib/deadlink/paths.rb', line 14 def deadlink_include? @deadlinks.any? end |
#print_deadlinks(opts) ⇒ Object
18 19 20 |
# File 'lib/deadlink/paths.rb', line 18 def print_deadlinks(opts) @deadlinks.each { |path| Decorator.print_info(path,opts) } end |