Class: JsDuck::Img::DirSet
- Inherits:
-
Object
- Object
- JsDuck::Img::DirSet
- Defined in:
- lib/jsduck/img/dir_set.rb
Overview
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.
Instance Method Summary collapse
- #all_used ⇒ Object
- #get(filename) ⇒ Object
-
#initialize(full_paths, relative_path) ⇒ DirSet
constructor
A new instance of DirSet.
- #report_unused ⇒ Object
Constructor Details
Instance Method Details
#all_used ⇒ Object
29 30 31 |
# File 'lib/jsduck/img/dir_set.rb', line 29 def all_used @dirs.map {|dir| dir.all_used }.flatten end |
#get(filename) ⇒ Object
20 21 22 23 24 25 26 27 |
# 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 ⇒ Object
33 34 35 |
# File 'lib/jsduck/img/dir_set.rb', line 33 def report_unused @dirs.each {|dir| dir.report_unused } end |