Class: CatHerder::Current
- Inherits:
-
ActiveSupport::CurrentAttributes
- Object
- ActiveSupport::CurrentAttributes
- CatHerder::Current
- Defined in:
- lib/cat_herder/current.rb
Instance Method Summary collapse
Instance Method Details
#dir_children(path) ⇒ Object
15 16 17 |
# File 'lib/cat_herder/current.rb', line 15 def dir_children(path) (self.dir_children_cache ||= {})[path] ||= File.directory?(path) ? Dir.children(path) : EMPTY_ARRAY end |
#mtime(path) ⇒ Object
11 12 13 |
# File 'lib/cat_herder/current.rb', line 11 def mtime(path) (self.mtime_cache ||= {})[path] ||= File.file?(path) ? File.mtime(path).to_f : Float::NAN end |
#resolved_paths ⇒ Object
7 8 9 |
# File 'lib/cat_herder/current.rb', line 7 def resolved_paths super || (self.resolved_paths = {}) end |