class JsDuck::Img::DirSet
A collection if Img::Dir
objects.
Looks up images from directories specified through –images option.
This class provides the same interface as Img::Dir
, except that the constructor takes array of full_paths not just one.
Public Class Methods
new(full_paths, relative_path)
click to toggle source
# File lib/jsduck/img/dir_set.rb, line 16 def initialize(full_paths, relative_path) @dirs = full_paths.map {|path| Img::Dir.new(path, relative_path) } end
Public Instance Methods
all_used()
click to toggle source
# File lib/jsduck/img/dir_set.rb, line 29 def all_used @dirs.map {|dir| dir.all_used }.flatten end
get(filename)
click to toggle source
# File lib/jsduck/img/dir_set.rb, line 20 def get(filename) @dirs.each do |dir| if img = dir.get(filename) return img end end return nil end
report_unused()
click to toggle source
# File lib/jsduck/img/dir_set.rb, line 33 def report_unused @dirs.each {|dir| dir.report_unused } end