Class: HaveAPI::Fs::Components::ProxyFile

Inherits:
File show all
Defined in:
lib/haveapi/fs/components/proxy_file.rb

Instance Attribute Summary

Attributes inherited from HaveAPI::Fs::Component

#atime, #context, #ctime, #mtime

Instance Method Summary collapse

Methods inherited from File

#file?, #raw_close, #raw_open, #raw_read, #raw_sync, #raw_truncate, #raw_write, #write

Methods inherited from HaveAPI::Fs::Component

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

Constructor Details

#initialize(path) ⇒ ProxyFile

Returns a new instance of ProxyFile.



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

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

Instance Method Details

#readObject



17
18
19
# File 'lib/haveapi/fs/components/proxy_file.rb', line 17

def read
  ::File.read(@path)
end

#sizeObject



13
14
15
# File 'lib/haveapi/fs/components/proxy_file.rb', line 13

def size
  ::File.size(@path)
end

#timesObject



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

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