Class: HaveAPI::Fs::Components::ProxyDir

Inherits:
Directory show all
Defined in:
lib/haveapi/fs/components/proxy_dir.rb

Constant Summary

Constants included from Help

Help::SEARCH_PATH

Instance Attribute Summary

Attributes inherited from HaveAPI::Fs::Component

#atime, #context, #ctime, #mtime

Instance Method Summary collapse

Methods inherited from Directory

#directory?

Methods included from Help

find!, included

Methods inherited from HaveAPI::Fs::Component

#abspath, #bound=, #bound?, children_reader, component, #directory?, #executable?, #file?, #find, inherited, #invalid?, #invalidate, #parent, #path, #readable?, #reset, #title, #unsaved?, #use, #writable?

Constructor Details

#initialize(path) ⇒ ProxyDir

Returns a new instance of ProxyDir.



3
4
5
6
# File 'lib/haveapi/fs/components/proxy_dir.rb', line 3

def initialize(path)
  super()
  @path = path
end

Instance Method Details

#contentsObject



14
15
16
# File 'lib/haveapi/fs/components/proxy_dir.rb', line 14

def contents
  @dir.entries[2..-1]
end

#setupObject



8
9
10
11
12
# File 'lib/haveapi/fs/components/proxy_dir.rb', line 8

def setup
  super
  
  @dir = ::Dir.new(@path)
end

#timesObject



18
19
20
21
# File 'lib/haveapi/fs/components/proxy_dir.rb', line 18

def times
  st = ::File.stat(@path)
  [st.atime, st.mtime, st.ctime]
end