class VirtFS::NativeFS::Thin::Dir
Attributes
dir_obj[R]
fs[R]
Public Class Methods
new(fs, instance_handle, hash_args)
click to toggle source
# File lib/virtfs/nativefs/thin/dir.rb, line 6 def initialize(fs, instance_handle, hash_args) @fs = fs @dir_obj = instance_handle @hash_args = hash_args @cache = nil end
Public Instance Methods
close()
click to toggle source
# File lib/virtfs/nativefs/thin/dir.rb, line 14 def close @dir_obj.close end
read(pos)
click to toggle source
returns file_name and new position.
# File lib/virtfs/nativefs/thin/dir.rb, line 19 def read(pos) return cache[pos], pos + 1 end
Private Instance Methods
cache()
click to toggle source
# File lib/virtfs/nativefs/thin/dir.rb, line 25 def cache @cache ||= @dir_obj.each.to_a end