Class: Deadlink::Paths

Inherits:
Object
  • Object
show all
Defined in:
lib/deadlink/paths.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Returns the value of attribute deadlinks.



4
5
6
# File 'lib/deadlink/paths.rb', line 4

def deadlinks
  @deadlinks
end

Instance Method Details

#countObject



22
23
24
# File 'lib/deadlink/paths.rb', line 22

def count
  @paths.count
end

Returns:

  • (Boolean)


14
15
16
# File 'lib/deadlink/paths.rb', line 14

def deadlink_include?
  @deadlinks.any?
end


18
19
20
# File 'lib/deadlink/paths.rb', line 18

def print_deadlinks(opts)
  @deadlinks.each { |path| Decorator.print_info(path,opts) }
end