Class: Zim::Directory

Inherits:
Array
  • Object
show all
Defined in:
lib/zim/structs.rb

Instance Method Summary collapse

Constructor Details

#initialize(f, count, clazz) ⇒ Directory

Returns a new instance of Directory.



58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/zim/structs.rb', line 58

def initialize(f, count, clazz)
  super()

  poses = Array.new
  count.times do
    pos = f.read_int64
    poses << pos
  end

  poses.each do |pos|
    f.seek(pos)
    self << clazz.new(f)
  end
end