Class: VirtFS::NativeFS::Thin::Dir

Inherits:
Object
  • Object
show all
Defined in:
lib/virtfs/nativefs/thin/dir.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fs, instance_handle, hash_args) ⇒ Dir

Returns a new instance of Dir.



6
7
8
9
10
11
12
# 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

Instance Attribute Details

#dir_objObject (readonly)

Returns the value of attribute dir_obj.



4
5
6
# File 'lib/virtfs/nativefs/thin/dir.rb', line 4

def dir_obj
  @dir_obj
end

#fsObject (readonly)

Returns the value of attribute fs.



4
5
6
# File 'lib/virtfs/nativefs/thin/dir.rb', line 4

def fs
  @fs
end

Instance Method Details

#closeObject



14
15
16
# File 'lib/virtfs/nativefs/thin/dir.rb', line 14

def close
  @dir_obj.close
end

#read(pos) ⇒ Object

returns file_name and new position.



19
20
21
# File 'lib/virtfs/nativefs/thin/dir.rb', line 19

def read(pos)
  return cache[pos], pos + 1
end